diff options
Diffstat (limited to 'src/components/shared/TextFilter.tsx')
| -rw-r--r-- | src/components/shared/TextFilter.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/shared/TextFilter.tsx b/src/components/shared/TextFilter.tsx new file mode 100644 index 0000000..79c2cfb --- /dev/null +++ b/src/components/shared/TextFilter.tsx @@ -0,0 +1,19 @@ +import type { PrimitiveAtom } from 'jotai'; +import * as React from 'react'; + +import { useTextInput } from '~/hooks/useTextInput'; + +import s from './TextFilter.module.scss'; + +export function TextFilter(props: { textAtom: PrimitiveAtom<string>; placeholder?: string }) { + const [onChange, text] = useTextInput(props.textAtom); + return ( + <input + className={s.input} + type="text" + value={text} + onChange={onChange} + placeholder={props.placeholder} + /> + ); +} |
