diff --git a/src/components/organisms/RightSidePanel.tsx b/src/components/organisms/RightSidePanel.tsx index 27dffaea..d73c0eae 100644 --- a/src/components/organisms/RightSidePanel.tsx +++ b/src/components/organisms/RightSidePanel.tsx @@ -9,6 +9,7 @@ import Typography from "@mui/material/Typography"; import { useGlobalInfoStore } from "../../context/globalInfo"; import { PairForEdit } from "../../pages/RecordingPage"; import { useActionContext } from '../../context/browserActions'; +import { useBrowserSteps } from '../../context/browserSteps'; interface RightSidePanelProps { pairForEdit: PairForEdit; @@ -24,12 +25,12 @@ export const RightSidePanel = ({ pairForEdit }: RightSidePanelProps) => { const [content, setContent] = useState('action'); const [action, setAction] = useState(''); const [isSettingsDisplayed, setIsSettingsDisplayed] = useState(false); - const [browserSteps, setBrowserSteps] = useState([]); const [stepLabel, setStepLabel] = useState(''); const [stepDescription, setStepDescription] = useState(''); const { lastAction } = useGlobalInfoStore(); const { getText, getScreenshot, startGetText, stopGetText, startGetScreenshot, stopGetScreenshot } = useActionContext(); + const { browserSteps } = useBrowserSteps(); const handleChange = (event: React.SyntheticEvent, newValue: string) => { setContent(newValue); @@ -41,19 +42,19 @@ export const RightSidePanel = ({ pairForEdit }: RightSidePanelProps) => { setIsSettingsDisplayed(true); }; - const confirmStep = () => { - setBrowserSteps([ - ...browserSteps, - { id: Date.now(), label: stepLabel, description: stepDescription } - ]); - setStepLabel(''); - setStepDescription(''); - }; + // const confirmStep = () => { + // setBrowserSteps([ + // ...browserSteps, + // { id: Date.now(), label: stepLabel, description: stepDescription } + // ]); + // setStepLabel(''); + // setStepDescription(''); + // }; - const discardStep = () => { - setStepLabel(''); - setStepDescription(''); - }; + // const discardStep = () => { + // setStepLabel(''); + // setStepDescription(''); + // }; return ( { )} - - setStepLabel(e.target.value)} - /> - setStepDescription(e.target.value)} - /> - - - + + {browserSteps.map(step => ( + + {step.label} + {step.value} + + ))} - - - - {browserSteps.map(step => ( - - {step.label} - {step.description} - - ))} - ); };