File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,10 @@ import { TextField } from "@/components/ui/text-field";
4
4
import { useExplorer } from "@/hooks/use-explorer" ;
5
5
import { useAST } from "@/hooks/use-ast" ;
6
6
import { cn } from "@/lib/utils" ;
7
+ import { esquerySelectorPlaceholder } from "@/lib/const" ;
7
8
8
9
export const EsquerySelectorInput : FC = ( ) => {
9
- const { esquerySelector, setEsquerySelector } = useExplorer ( ) ;
10
+ const { esquerySelector, setEsquerySelector, language } = useExplorer ( ) ;
10
11
const astParseResult = useAST ( ) ;
11
12
const htmlId = useId ( ) ;
12
13
@@ -21,7 +22,7 @@ export const EsquerySelectorInput: FC = () => {
21
22
</ Label >
22
23
< TextField
23
24
id = { htmlId }
24
- placeholder = { 'e.g. "ImportDeclaration > Literal"' }
25
+ placeholder = { esquerySelectorPlaceholder [ language ] }
25
26
className = { cn (
26
27
"flex-1" ,
27
28
! astParseResult . ok ||
Original file line number Diff line number Diff line change @@ -256,6 +256,14 @@ export const pathViewOptions = [
256
256
} ,
257
257
] ;
258
258
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
+
259
267
export const defaultJsCode = `
260
268
/**
261
269
* Type or paste some JavaScript here to learn more about
You can’t perform that action at this time.
0 commit comments