summaryrefslogtreecommitdiff
path: root/src/components/shared/TextFitler.tsx
blob: 1a78ca2b5c99cb49ea23f16bea83c200f69eef0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import * as React from 'react';
import type { RecoilState } from 'recoil';

import { useTextInut } from '~/hooks/useTextInput';

import s from './TextFitler.module.scss';

export function TextFilter(props: { textAtom: RecoilState<string>; placeholder?: string }) {
  const [onChange, text] = useTextInut(props.textAtom);
  return (
    <input
      className={s.input}
      type="text"
      value={text}
      onChange={onChange}
      placeholder={props.placeholder}
    />
  );
}