import { useTranslation } from 'react-i18next' import { MergeAndOverride } from '../../../../../types/utils' import OLForm from '@/features/ui/components/ol/ol-form' import OLFormControl from '@/features/ui/components/ol/ol-form-control' import MaterialIcon from '@/shared/components/material-icon' type SearchFormOwnProps = { inputValue: string setInputValue: (input: string) => void } type SearchFormProps = MergeAndOverride< React.ComponentProps, SearchFormOwnProps > export default function SearchForm({ inputValue, setInputValue, }: SearchFormProps) { const { t } = useTranslation() let placeholderMessage = t('search') const placeholder = `${placeholderMessage}…` const handleChange: React.ComponentProps['onChange'] = e => { setInputValue(e.target.value) } const handleClear = () => setInputValue('') return ( e.preventDefault()} > } append={ inputValue.length > 0 && ( ) } /> ) }