implemented inputFile component

This commit is contained in:
anovazzi1 2023-03-29 20:27:39 -03:00
commit 48995bc395
4 changed files with 76 additions and 2 deletions

View file

@ -11,6 +11,7 @@ import { ParameterComponentType } from "../../../../types/components";
import FloatComponent from "../../../../components/floatComponent";
import Dropdown from "../../../../components/dropdownComponent";
import CodeAreaComponent from "../../../../components/codeAreaComponent";
import InputFileComponent from "../../../../components/inputFileComponent";
export default function ParameterComponent({
left,
@ -54,7 +55,12 @@ export default function ParameterComponent({
{title}
<span className="text-red-600">{required ? " *" : ""}</span>
</div>
{left && (type === "str" || type === "bool" || type === "float"||type=="code") ? (
{left &&
(type === "str" ||
type === "bool" ||
type === "float" ||
type === "code" ||
type === "file") ? (
<></>
) : (
<Tooltip title={tooltipTitle + (required ? " (required)" : "")}>
@ -148,6 +154,14 @@ export default function ParameterComponent({
data.node.template[name].value = t;
}}
/>
) : left === true && type === "file" ? (
<InputFileComponent
disabled={disabled}
value={data.node.template[name].value ?? ""}
onChange={(t: string) => {
data.node.template[name].value = t;
}}
></InputFileComponent>
) : (
<></>
)}