aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor/SearchPanelPortal.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/editor/SearchPanelPortal.tsx')
-rw-r--r--subprojects/frontend/src/editor/SearchPanelPortal.tsx25
1 files changed, 25 insertions, 0 deletions
diff --git a/subprojects/frontend/src/editor/SearchPanelPortal.tsx b/subprojects/frontend/src/editor/SearchPanelPortal.tsx
new file mode 100644
index 00000000..e8301489
--- /dev/null
+++ b/subprojects/frontend/src/editor/SearchPanelPortal.tsx
@@ -0,0 +1,25 @@
1import Portal from '@mui/material/Portal';
2import { observer } from 'mobx-react-lite';
3import React from 'react';
4
5import type EditorStore from './EditorStore';
6import SearchToolbar from './SearchToolbar';
7
8function SearchPanelPortal({
9 editorStore: { searchPanel: searchPanelStore },
10}: {
11 editorStore: EditorStore;
12}): JSX.Element | null {
13 const { element: searchPanelContainer } = searchPanelStore;
14
15 if (searchPanelContainer === undefined) {
16 return null;
17 }
18 return (
19 <Portal container={searchPanelContainer}>
20 <SearchToolbar searchPanelStore={searchPanelStore} />
21 </Portal>
22 );
23}
24
25export default observer(SearchPanelPortal);