Refactor IOInputField component to handle different input types

This commit is contained in:
anovazzi1 2024-01-26 14:32:48 -03:00
commit fbcd2ea4a4

View file

@ -6,15 +6,27 @@ export default function IOInputField({
value, value,
updateValue, updateValue,
}: IOInputProps): JSX.Element | undefined { }: IOInputProps): JSX.Element | undefined {
switch (inputType) { function handleInputType() {
case "TextInput": switch (inputType) {
return ( case "TextInput":
<Textarea return (
className="custom-scroll" <Textarea
placeholder={"Enter text..."} className="custom-scroll"
value={value} placeholder={"Enter text..."}
onChange={updateValue} value={value}
/> onChange={updateValue}
); />
);
default:
return (
<Textarea
className="custom-scroll"
placeholder={"Enter text..."}
value={value}
onChange={updateValue}
/>
);
}
} }
return <div className="h-full">{handleInputType()}</div>;
} }