feat: add response filter placeholder (#1293)

This commit is contained in:
Tuyen Pham 2024-01-29 21:55:36 +07:00 committed by GitHub
parent 969c44023f
commit acc646a05d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,18 @@ const QueryResultFilter = ({ onChange, mode }) => {
return null;
}, [mode]);
const placeholderText = useMemo(() => {
if (mode.includes('json')) {
return '$.store.books..author';
}
if (mode.includes('xml')) {
return '/store/books//author';
}
return null;
}, [mode]);
return (
<div className={'response-filter relative'}>
@ -29,6 +41,7 @@ const QueryResultFilter = ({ onChange, mode }) => {
type="text"
name="response-filter"
id="response-filter"
placeholder={placeholderText}
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"