import React from 'react'; export type SetStateInputMethod = (name: NameType, newValue: string) => void; interface ISimpleInput { inputData: { title: string; name: string; }; className?: string; stateHanlder: { state: string; setState: SetStateInputMethod; }; } export default function SimpleInput(props: ISimpleInput) { const { className, inputData, stateHanlder } = props; const { name, title } = inputData; const { setState, state } = stateHanlder; const handleInputChange = (e: React.ChangeEvent) => { const { value, name: inputName } = e.target; setState(inputName as NameType, value); }; return (
); }