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,
|
||||
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>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue