From 7aa3c5f4949261d68c6692f58bf26fd995389dad Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 22 Mar 2024 17:48:19 +0100 Subject: [PATCH] Added type into new Global input component --- .../src/components/inputGlobalComponent/index.tsx | 3 ++- src/frontend/src/types/components/index.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/components/inputGlobalComponent/index.tsx b/src/frontend/src/components/inputGlobalComponent/index.tsx index 5fa64c4de..bf6a5555e 100644 --- a/src/frontend/src/components/inputGlobalComponent/index.tsx +++ b/src/frontend/src/components/inputGlobalComponent/index.tsx @@ -9,6 +9,7 @@ import AddNewVariableButton from "../addNewVariableButtonComponent/addNewVariabl import ForwardedIconComponent from "../genericIconComponent"; import InputComponent from "../inputComponent"; import { CommandItem } from "../ui/command"; +import { InputGlobalComponentType } from "../../types/components"; export default function InputGlobalComponent({ disabled, @@ -16,7 +17,7 @@ export default function InputGlobalComponent({ setDb, name, data, -}) { +}: InputGlobalComponentType): JSX.Element { const globalVariablesEntries = useGlobalVariablesStore( (state) => state.globalVariablesEntries ); diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 4395ab24c..afa42d312 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -71,6 +71,15 @@ export type InputListComponentType = { editNode?: boolean; }; +export type InputGlobalComponentType = + { + disabled: boolean, + onChange: (value: string) => void, + setDb: (value: boolean) => void, + name: string, + data: NodeDataType, + }; + export type KeyPairListComponentType = { value: any; onChange: (value: Object[]) => void;