File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,9 +4,10 @@ import { TextField } from "@/components/ui/text-field";
44import { useExplorer } from "@/hooks/use-explorer" ;
55import { useAST } from "@/hooks/use-ast" ;
66import { cn } from "@/lib/utils" ;
7+ import { esquerySelectorPlaceholder } from "@/lib/const" ;
78
89export const EsquerySelectorInput : FC = ( ) => {
9- const { esquerySelector, setEsquerySelector } = useExplorer ( ) ;
10+ const { esquerySelector, setEsquerySelector, language } = useExplorer ( ) ;
1011 const astParseResult = useAST ( ) ;
1112 const htmlId = useId ( ) ;
1213
@@ -21,7 +22,7 @@ export const EsquerySelectorInput: FC = () => {
2122 </ Label >
2223 < TextField
2324 id = { htmlId }
24- placeholder = { 'e.g. "ImportDeclaration > Literal"' }
25+ placeholder = { esquerySelectorPlaceholder [ language ] }
2526 className = { cn (
2627 "flex-1" ,
2728 ! astParseResult . ok ||
Original file line number Diff line number Diff line change @@ -256,6 +256,14 @@ export const pathViewOptions = [
256256 } ,
257257] ;
258258
259+ export const esquerySelectorPlaceholder = {
260+ javascript : 'e.g. "ImportDeclaration > Literal"' ,
261+ json : 'e.g. "Member > String"' ,
262+ markdown : 'e.g. "Heading > Text"' ,
263+ css : 'e.g. "Block > Declaration"' ,
264+ html : 'e.g. "Document > Doctype"' ,
265+ } ;
266+
259267export const defaultJsCode = `
260268/**
261269 * Type or paste some JavaScript here to learn more about
You can’t perform that action at this time.
0 commit comments