import React, { useContext, useEffect } from "react"; import InputRow from "../../values-form/InputRow"; import useFormField from "../hooks/useFormField"; import { StringInputField, StringInputFieldState } from "../types"; interface Props extends StringInputField { id: string; } const StringInput: React.FC = ({ id, label, required, placeholder, info, }) => { const { state, updateState } = useFormField(id, { value: "", }); // TODO: needs a loading wrapper if (state == undefined) { return <>; } return ( { updateState((prev) => { return { ...prev, value: x, }; }); }} label={label} isRequired={required} placeholder={placeholder} info={info} /> ); }; export default StringInput;