import React, { ChangeEventHandler } from 'react'; import { ErrorMessage } from '../../primitives/Errors'; import { TextInput } from '../../primitives/Input'; import ErrorIcon from '../graphics/ErrorIcon'; import { RenderWithData } from '../../index'; type Props = RenderWithData<"Input", string> & { update?: (value: string) => void } export default function Input({ heading, property, errors, disabled, currentValue, placeholder, autocomplete, inputType, setData, update, }: Props) { const handleChange: ChangeEventHandler = (e) => { setData(property, e.target.value); update?.(e.target.value); }; return (
{errors?.validation?.error && ( {errors.validation.message} )}
); }