Refactored addNewVariableButton.tsx to use useTypesStore for componentFields

This commit is contained in:
anovazzi1 2024-04-29 23:29:06 -03:00
commit 8e78e23a9a

View file

@ -10,6 +10,7 @@ import { Button } from "../ui/button";
import { Input } from "../ui/input";
import { Label } from "../ui/label";
import { Textarea } from "../ui/textarea";
import { useTypesStore } from "../../stores/typesStore";
//TODO IMPLEMENT FORM LOGIC
@ -19,6 +20,7 @@ export default function AddNewVariableButton({ children }): JSX.Element {
const [type, setType] = useState("");
const [open, setOpen] = useState(false);
const setErrorData = useAlertStore((state) => state.setErrorData);
const componentFields = useTypesStore((state) => state.ComponentFields);
const addGlobalVariable = useGlobalVariablesStore(
(state) => state.addGlobalVariable
);