import React, { FC } from 'react'; import { TextField } from '@material-ui/core'; type Props = { id: string; label: string; error: boolean; errorMessage: string; value: string; onChange: any; }; export const InputField: FC<Props> = (props: Props) => { const { id, label, error, errorMessage, onChange, value } = props; return ( <TextField variant="outlined" margin="normal" required fullWidth id={id} label={label} name={id} onChange={onChange} value={value} autoComplete={id} autoFocus error={error} helperText={error && errorMessage} /> ); };