import classNames from 'classnames'; import { type ChangeEvent, type FormEvent, type FunctionComponent } from 'react'; import { useDispatch } from 'react-redux'; import { LOCALE_FEATURES } from 'i18n'; import { dictionarySlice, selectDictionary, selectLocale, useTranslate, useTypedSelector } from 'state'; import styles from './DictionaryInput.module.scss'; interface Props { className?: string; } export const DictionaryInput: FunctionComponent = ({ className }) => { const dispatch = useDispatch(); const translate = useTranslate(); const locale = useTypedSelector(selectLocale); const { input } = useTypedSelector(selectDictionary); const { comma } = LOCALE_FEATURES[locale]; const handleChange = (event: ChangeEvent) => { dispatch(dictionarySlice.actions.changeInput(event.target.value)); }; const handleSubmit = (event: FormEvent) => { event.preventDefault(); dispatch(dictionarySlice.actions.submit()); }; return (
); };