diff --git a/src/hooks/use-auto-complete.hooks.ts b/src/hooks/use-auto-complete.hooks.ts index c7fd65d..41d0232 100644 --- a/src/hooks/use-auto-complete.hooks.ts +++ b/src/hooks/use-auto-complete.hooks.ts @@ -11,9 +11,10 @@ interface UseAutoCompleteProps { export interface AutoCompleteResult { content: string; id: number; + isChecked: boolean; } -export const useAutoComplete = ({ content, delay = 1000 }: UseAutoCompleteProps) => { +export const useAutoComplete = ({ content, delay = 400 }: UseAutoCompleteProps) => { const [results, setResults] = useState([]); const [error, setError] = useState(null); const { type, category } = useTypeStore(); diff --git a/src/ui/components/atom/auto-complete/auto-complete.tsx b/src/ui/components/atom/auto-complete/auto-complete.tsx index ca90986..54efc1b 100644 --- a/src/ui/components/atom/auto-complete/auto-complete.tsx +++ b/src/ui/components/atom/auto-complete/auto-complete.tsx @@ -14,15 +14,18 @@ const AutoCompleteList: React.FC = ({ results, onSelect } return (
    - {results.map((result, index) => ( -
  • onSelect(result.content, result.id)} - > - {result.content} -
  • - ))} + {results.map( + (result, index) => + result.isChecked && ( +
  • onSelect(result.content, result.id)} + > + {result.content} +
  • + ), + )}
);