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,
updateValue,
}: IOInputProps): JSX.Element | undefined {
switch (inputType) {
case "TextInput":
return (
<Textarea
className="custom-scroll"
placeholder={"Enter text..."}
value={value}
onChange={updateValue}
/>
);
function handleInputType() {
switch (inputType) {
case "TextInput":
return (
<Textarea
className="custom-scroll"
placeholder={"Enter text..."}
value={value}
onChange={updateValue}
/>
);
default:
return (
<Textarea
className="custom-scroll"
placeholder={"Enter text..."}
value={value}
onChange={updateValue}
/>
);
}
}
return <div className="h-full">{handleInputType()}</div>;
}