diff --git a/editor.planx.uk/src/@planx/components/SetValue/Editor.tsx b/editor.planx.uk/src/@planx/components/SetValue/Editor.tsx index b1ebc9de72..bf3bc2bea4 100644 --- a/editor.planx.uk/src/@planx/components/SetValue/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/SetValue/Editor.tsx @@ -1,11 +1,15 @@ +import Box from "@mui/material/Box"; import FormControl from "@mui/material/FormControl"; import RadioGroup from "@mui/material/RadioGroup"; +import Tabs from "@mui/material/Tabs"; import Typography from "@mui/material/Typography"; import { ComponentType as TYPES } from "@opensystemslab/planx-core/types"; import BasicRadio from "@planx/components/shared/Radio/BasicRadio"; import { EditorProps } from "@planx/components/shared/types"; import { useFormik } from "formik"; -import React from "react"; +import { TabList } from "pages/FlowEditor/components/Sidebar"; +import StyledTab from "pages/FlowEditor/components/Sidebar/StyledTab"; +import React, { useState } from "react"; import { ModalFooter } from "ui/editor/ModalFooter"; import ModalSection from "ui/editor/ModalSection"; import ModalSectionContent from "ui/editor/ModalSectionContent"; @@ -17,8 +21,6 @@ import { parseSetValue, SetValue } from "./model"; type Props = EditorProps; -export default SetValueComponent; - interface Option { value: SetValue["operation"]; label: string; @@ -77,7 +79,9 @@ const DescriptionText: React.FC = ({ fn, val, operation }) => { } }; -function SetValueComponent(props: Props) { +const SetValueComponent: React.FC = (props) => { + const [activeTab, setActiveTab] = useState(0); + const formik = useFormik({ initialValues: parseSetValue(props.node?.data), onSubmit: (newValues) => { @@ -93,49 +97,99 @@ function SetValueComponent(props: Props) { formik.setFieldValue("operation", target.value); }; + const handleTabChange = (event: React.SyntheticEvent, newValue: number) => { + setActiveTab(newValue); + }; + return (