From 476a670eb9d84fdcce8764492924e72c5c6cd2e7 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 5 Feb 2024 18:58:37 -0300 Subject: [PATCH] Add global variables support to InputComponent --- .../src/components/inputComponent/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index 2762c5d21..d0e6b3c77 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -1,6 +1,7 @@ import { Listbox, Transition } from "@headlessui/react"; import * as Form from "@radix-ui/react-form"; import { Fragment, useEffect, useRef, useState } from "react"; +import { useGlobalVariablesStore } from "../../stores/globalVariables"; import { InputComponentType } from "../../types/components"; import { handleKeyDown } from "../../utils/reactflowUtils"; import { classNames } from "../../utils/utils"; @@ -26,13 +27,12 @@ export default function InputComponent({ const [pwdVisible, setPwdVisible] = useState(false); const refInput = useRef(null); const [showOptions, setShowOptions] = useState(false); - const [filteredOpts, setFilteredValue] = useState([ - "key", - "key2", - "key3", - "key4", - "key5", - ]); + const globalVariablesEntries = useGlobalVariablesStore( + (state) => state.globalVariablesEntries + ); + const [filteredOpts, setFilteredValue] = useState( + globalVariablesEntries + ); // Clear component state useEffect(() => {