| 25 | type FileSelectKey = 'checker' | 'interactor' | 'manager'; |
| 26 | |
| 27 | export function ManagedInput({ placeholder, formKey }: { placeholder?: string, formKey: KeyType<RootState['config']> }) { |
| 28 | const value = useSelector((state: RootState) => state.config[formKey]); |
| 29 | const dispatch = useDispatch(); |
| 30 | return ( |
| 31 | <input |
| 32 | placeholder={i18n(placeholder)} |
| 33 | value={value || ''} |
| 34 | type={typeof value === 'number' ? 'number' : 'text'} |
| 35 | onChange={(ev) => { |
| 36 | dispatch({ type: 'CONFIG_FORM_UPDATE', key: formKey, value: ev.currentTarget.value }); |
| 37 | }} |
| 38 | className="textbox" |
| 39 | /> |
| 40 | ); |
| 41 | } |
| 42 | |
| 43 | export function ManagedSelect({ options, formKey }: { options: string[], formKey: KeyType<RootState['config']> }) { |
| 44 | const value = useSelector((state: RootState) => state.config[formKey]); |