From 517172175e24d451cecbb84116c8473efbc71e8b Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 24 Jun 2024 22:42:22 +0530 Subject: [PATCH] feat: right panel --- src/components/organisms/RightSidePanel.tsx | 106 ++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 src/components/organisms/RightSidePanel.tsx diff --git a/src/components/organisms/RightSidePanel.tsx b/src/components/organisms/RightSidePanel.tsx new file mode 100644 index 00000000..3ad8dff5 --- /dev/null +++ b/src/components/organisms/RightSidePanel.tsx @@ -0,0 +1,106 @@ +import React, { useEffect, useState } from 'react'; +import { Button, MenuItem, Paper, Stack, Tabs, Tab } from "@mui/material"; +import { Dropdown as MuiDropdown } from '../atoms/DropdownMui'; +import styled from "styled-components"; +import { ActionSettings } from "../molecules/ActionSettings"; +import { SelectChangeEvent } from "@mui/material/Select/Select"; +import { SimpleBox } from "../atoms/Box"; +import Typography from "@mui/material/Typography"; +import { useGlobalInfoStore } from "../../context/globalInfo"; +import { PairDetail } from "../molecules/PairDetail"; +import { PairForEdit } from "../../pages/RecordingPage"; + +interface RightSidePanelProps { + pairForEdit: PairForEdit; + changeBrowserDimensions: () => void; +} + +export const RightSidePanel = ({pairForEdit, changeBrowserDimensions}: RightSidePanelProps) => { + + const [content, setContent] = useState('action'); + const [action, setAction] = React.useState(''); + const [isSettingsDisplayed, setIsSettingsDisplayed] = React.useState(false); + + const { lastAction } = useGlobalInfoStore(); + + const handleChange = (event: React.SyntheticEvent, newValue: string) => { + setContent(newValue); + }; + + const handleActionSelect = (event: SelectChangeEvent) => { + const { value } = event.target; + setAction(value); + setIsSettingsDisplayed(true); + }; + + useEffect(() => { + if (content !== 'detail' && pairForEdit.pair !== null) { + setContent('detail'); + } + }, [pairForEdit]) + + return ( + + + + + Last action: + {` ${lastAction}`} + + + + + + + + + {content === 'action' ? ( + + Type of action: + + + click on coordinates + enqueueLinks + scrape + scrapeSchema + screenshot + script + scroll + + + + {isSettingsDisplayed && + + } + + ) + : + } + + ); +}; + +const ActionTypeWrapper = styled.div` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin-top: 20px; +`; + +export const ActionDescription = styled.p` + margin-left: 15px; +`;