diff --git a/src/frontend/src/pages/globalVariablesPage/components/addNewVariableButton.tsx b/src/frontend/src/pages/globalVariablesPage/components/addNewVariableButton.tsx index 59e86fe3e..17f815c60 100644 --- a/src/frontend/src/pages/globalVariablesPage/components/addNewVariableButton.tsx +++ b/src/frontend/src/pages/globalVariablesPage/components/addNewVariableButton.tsx @@ -1,13 +1,19 @@ +import { useState } from "react"; import { Button } from "../../../components/ui/button"; import { Input } from "../../../components/ui/input"; import { Label } from "../../../components/ui/label"; import { Textarea } from "../../../components/ui/textarea"; +import { registerGlobalVariable } from "../../../controllers/API"; import BaseModal from "../../../modals/baseModal"; //TODO IMPLEMENT FORM LOGIC export default function AddNewVariableButton(): JSX.Element { - function handleSaveVariable() {} + const [key, setKey] = useState(""); + const [value, setValue] = useState(""); + function handleSaveVariable() { + registerGlobalVariable(key, value).then((_) => {}); + } return (
- + { + setKey(e.target.value); + }} + placeholder="example name" + >
-