Refactor IOInputField component to handle different input types
This commit is contained in:
parent
4af5aa56c2
commit
fbcd2ea4a4
1 changed files with 22 additions and 10 deletions
|
|
@ -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>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue