summaryrefslogtreecommitdiff
path: root/src/components/shared/TextFitler.tsx
blob: e4a4a880178120269e55dc4061e0d24db92ef5bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as React from 'react';
import type { RecoilState } from 'recoil';
import { useTextInut } from 'src/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}
    />
  );
}