Refactor IOInputField and IOView components

This commit is contained in:
anovazzi1 2024-01-26 15:12:02 -03:00
commit 870204eb40
3 changed files with 5 additions and 5 deletions

View file

@ -3,7 +3,7 @@ import { Textarea } from "../ui/textarea";
export default function IOInputField({ export default function IOInputField({
inputType, inputType,
value, field,
updateValue, updateValue,
}: IOInputProps): JSX.Element | undefined { }: IOInputProps): JSX.Element | undefined {
function handleInputType() { function handleInputType() {
@ -13,7 +13,7 @@ export default function IOInputField({
<Textarea <Textarea
className="custom-scroll" className="custom-scroll"
placeholder={"Enter text..."} placeholder={"Enter text..."}
value={value} value={field.value}
onChange={updateValue} onChange={updateValue}
/> />
); );
@ -25,7 +25,7 @@ export default function IOInputField({
<Textarea <Textarea
className="custom-scroll" className="custom-scroll"
placeholder={"Enter text..."} placeholder={"Enter text..."}
value={value} value={field.value}
onChange={updateValue} onChange={updateValue}
/> />
); );

View file

@ -67,7 +67,7 @@ export default function IOView(): JSX.Element {
<div className="file-component-tab-column"> <div className="file-component-tab-column">
{node && ( {node && (
<IOInputField <IOInputField
value={node.data.node!.template.value.value} field={node.data.node!.template["value"]}
inputType={input.type} inputType={input.type}
updateValue={(e) => { updateValue={(e) => {
e.target.value; e.target.value;

View file

@ -648,6 +648,6 @@ export type dropdownButtonPropsType = {
export type IOInputProps = { export type IOInputProps = {
inputType: string; inputType: string;
value: string; field: TemplateVariableType;
updateValue: (e: any) => void; updateValue: (e: any) => void;
}; };