import { ReactNode } from 'react'; import { Search, X } from 'lucide-react'; import clsx from 'clsx'; import { useLocalStorage } from '@/react/hooks/useLocalStorage'; import { AutomationTestingProps } from '@/types'; import { useDebounce } from '@/react/hooks/useDebounce'; import { Button } from '@@/buttons'; interface Props extends AutomationTestingProps { value: string; placeholder?: string; onChange(value: string): void; className?: string; children?: ReactNode; } export function SearchBar({ value, placeholder = 'Search...', onChange, 'data-cy': dataCy, className, children, }: Props) { const [searchValue, setSearchValue] = useDebounce(value, onChange); function onClear() { setSearchValue(''); } return (