Add file input component to IOInputField and update IOView to use new input structure

This commit is contained in:
anovazzi1 2024-01-26 14:52:00 -03:00
commit ff112cfd34
2 changed files with 24 additions and 24 deletions

View file

@ -17,6 +17,9 @@ export default function IOInputField({
onChange={updateValue} onChange={updateValue}
/> />
); );
case "fileInput":
return <div></div>;
default: default:
return ( return (
<Textarea <Textarea

View file

@ -41,17 +41,17 @@ export default function IOView(): JSX.Element {
<IconComponent name="Variable" className=" file-component-variable" /> <IconComponent name="Variable" className=" file-component-variable" />
<span className="file-component-variables-span text-md">Inputs</span> <span className="file-component-variables-span text-md">Inputs</span>
</div> </div>
{inputIds {inputs
.filter((input) => extractTypeFromLongId(input) !== "ChatInput") .filter((input) => input.type !== "ChatInput")
.map((inputId, index) => { .map((input, index) => {
const node: NodeType = nodes.find((node) => node.id === inputId)!; const node: NodeType = nodes.find((node) => node.id === input.id)!;
return ( return (
<div className="file-component-accordion-div" key={index}> <div className="file-component-accordion-div" key={index}>
<AccordionComponent <AccordionComponent
trigger={ trigger={
<div className="file-component-badge-div"> <div className="file-component-badge-div">
<Badge variant="gray" size="md"> <Badge variant="gray" size="md">
{inputId} {input.id}
</Badge> </Badge>
<div <div
className="-mb-1" className="-mb-1"
@ -62,17 +62,13 @@ export default function IOView(): JSX.Element {
</div> </div>
} }
key={index} key={index}
keyValue={inputId} keyValue={input.id}
> >
<div className="file-component-tab-column"> <div className="file-component-tab-column">
{node && (
<IOInputField <IOInputField
value={ value={node.data.node!.template.value.value}
nodes.find((node) => node.id === inputId)?.data.node inputType={input.type}
.template.value.value
}
inputType={
inputs.find((input) => input.id === inputId)?.type!
}
updateValue={(e) => { updateValue={(e) => {
e.target.value; e.target.value;
if (node) { if (node) {
@ -83,6 +79,7 @@ export default function IOView(): JSX.Element {
} }
}} }}
/> />
)}
</div> </div>
</AccordionComponent> </AccordionComponent>
</div> </div>