22 lines
745 B
TypeScript
22 lines
745 B
TypeScript
import { useTranslation } from 'react-i18next';
|
|
|
|
interface SearchInputProps {
|
|
value: string;
|
|
onChange: (value: string) => void;
|
|
placeholder?: string;
|
|
className?: string;
|
|
}
|
|
|
|
export function SearchInput({ value, onChange, placeholder, className = '' }: SearchInputProps) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<input
|
|
type="text"
|
|
value={value}
|
|
onChange={(e) => onChange(e.target.value)}
|
|
placeholder={placeholder ?? t('common.search')}
|
|
className={`w-full px-2 py-1 text-sm border rounded bg-white dark:bg-navy-800 dark:text-warm-200 border-warm-200 dark:border-navy-700 placeholder-warm-400 dark:placeholder-warm-500 focus:outline-none focus:ring-1 focus:ring-teal-400 ${className}`}
|
|
/>
|
|
);
|
|
}
|