import { useRef, useState } from 'react'; import { Button } from '@/components/ui/button'; import { Search as SearchIcon, X as ClearIcon } from 'lucide-react'; import { Input } from '@/components/ui/input'; import { cn } from 'helpers/cn'; import { useTranslation } from '@/components/locales'; type SearchInputProps = { className?: string; handleSearch: (value: string) => void; value?: string; placeholder?: string; }; export function SearchInput(props: SearchInputProps) { const { t } = useTranslation(); const { className, handleSearch, value = '', placeholder = t('search.placeholder') } = props; const [isMobileSearchOpen, setIsMobileSearchOpen] = useState(false); const inputRef = useRef(null); return (
{!!value ? ( ) : ( )} handleSearch(ev.target.value)} className="ps-10 pe-4 text-sm" />
); }