diff options
Diffstat (limited to 'subprojects/frontend/src/editor/EditorPane.tsx')
-rw-r--r-- | subprojects/frontend/src/editor/EditorPane.tsx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/subprojects/frontend/src/editor/EditorPane.tsx b/subprojects/frontend/src/editor/EditorPane.tsx new file mode 100644 index 00000000..935a84e8 --- /dev/null +++ b/subprojects/frontend/src/editor/EditorPane.tsx | |||
@@ -0,0 +1,38 @@ | |||
1 | import Box from '@mui/material/Box'; | ||
2 | import Stack from '@mui/material/Stack'; | ||
3 | import Toolbar from '@mui/material/Toolbar'; | ||
4 | import { observer } from 'mobx-react-lite'; | ||
5 | import React from 'react'; | ||
6 | |||
7 | import Loading from '../Loading'; | ||
8 | import { useRootStore } from '../RootStore'; | ||
9 | |||
10 | import EditorArea from './EditorArea'; | ||
11 | import EditorButtons from './EditorButtons'; | ||
12 | import GenerateButton from './GenerateButton'; | ||
13 | import SearchPanelPortal from './SearchPanelPortal'; | ||
14 | |||
15 | function EditorPane(): JSX.Element { | ||
16 | const { editorStore } = useRootStore(); | ||
17 | |||
18 | return ( | ||
19 | <Stack direction="column" flexGrow={1} flexShrink={1} overflow="auto"> | ||
20 | <Toolbar variant="dense"> | ||
21 | <EditorButtons editorStore={editorStore} /> | ||
22 | <GenerateButton editorStore={editorStore} /> | ||
23 | </Toolbar> | ||
24 | <Box flexGrow={1} flexShrink={1} overflow="auto"> | ||
25 | {editorStore === undefined ? ( | ||
26 | <Loading /> | ||
27 | ) : ( | ||
28 | <> | ||
29 | <SearchPanelPortal editorStore={editorStore} /> | ||
30 | <EditorArea editorStore={editorStore} /> | ||
31 | </> | ||
32 | )} | ||
33 | </Box> | ||
34 | </Stack> | ||
35 | ); | ||
36 | } | ||
37 | |||
38 | export default observer(EditorPane); | ||