-
Notifications
You must be signed in to change notification settings - Fork 190
Expand file tree
/
Copy pathindex.tsx
More file actions
55 lines (45 loc) · 2.05 KB
/
index.tsx
File metadata and controls
55 lines (45 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import * as React from "react";
import PanelCenter from "./PanelCenter.tsx";
import PanelLeft from "./PanelLeft.tsx";
import PanelRight from "./PanelRight.tsx";
import './Panels.styles.scss';
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
import { AppDispatch, RootState } from '../../store/index.ts';
import { updatePanelCollapse } from "../../store/slices/defaultPageSlice.ts";
import { Button } from "@fluentui/react-components";
const Page: React.FC = () => {
const dispatch = useDispatch<AppDispatch>();
const store = useSelector((state: RootState) => ({
isLeftPanelCollapse: state.defaultPage.isLeftPanelCollapse,
isRightPanelCollapse: state.defaultPage.isRightPanelCollapse,
isCenterPanelCollapse: state.defaultPage.isCenterPanelCollapse,
}), shallowEqual);
const togglePanel = (panel: string) => {
dispatch(updatePanelCollapse(panel))
}
return (
<div className="layout">
<div className={`panelLeftLayout ${store.isLeftPanelCollapse ? 'collapse' : 'expand'}`} >
<div className="collapseButtonDiv ">
<Button className="rotate-button" title="Expand Panel" onClick={() => togglePanel('Left')} appearance="primary">
Processing Queue
</Button>
</div>
<PanelLeft togglePanel={togglePanel} />
</div>
<div className={`panelCenter ${store.isCenterPanelCollapse ? 'collapse' : 'expand'}`}>
<div className="collapseButtonDiv">
<Button className="rotate-button" title="Expand Panel" onClick={() => togglePanel('Center')} appearance="primary">Output Review </Button>
</div>
<PanelCenter togglePanel={togglePanel} />
</div>
<div className={`panelRight ${store.isRightPanelCollapse ? 'collapse' : 'expand'}`}>
<div className="collapseButtonDiv">
<Button className="rotate-button" title="Expand Panel" onClick={() => togglePanel('Right')} appearance="primary">Source Document</Button>
</div>
<PanelRight togglePanel={togglePanel} />
</div>
</div>
);
};
export default Page;