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