Skip to content

Commit

Permalink
feat: add response filter placeholder (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuyen-at-work authored Jan 29, 2024
1 parent 969c440 commit acc646a
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'}>
Expand All @@ -29,6 +41,7 @@ const QueryResultFilter = ({ onChange, mode }) => {
type="text"
name="response-filter"
id="response-filter"
placeholder={placeholderText}
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
Expand Down

0 comments on commit acc646a

Please sign in to comment.