| 19 | }) |
| 20 | |
| 21 | export function renderZenNotesApp(root: HTMLElement): void { |
| 22 | const params = new URLSearchParams(window.location.search) |
| 23 | const isFloating = params.get('floating') === '1' |
| 24 | const isQuickCapture = params.get('quickCapture') === '1' |
| 25 | const isExternalFile = params.get('externalFile') !== null |
| 26 | const floatingNotePath = params.get('note') |
| 27 | |
| 28 | ReactDOM.createRoot(root).render( |
| 29 | <React.StrictMode> |
| 30 | <Suspense fallback={null}> |
| 31 | {isQuickCapture ? ( |
| 32 | <QuickCaptureApp /> |
| 33 | ) : isExternalFile ? ( |
| 34 | <ExternalFileApp /> |
| 35 | ) : isFloating && floatingNotePath ? ( |
| 36 | <FloatingNoteApp notePath={floatingNotePath} /> |
| 37 | ) : ( |
| 38 | <App /> |
| 39 | )} |
| 40 | </Suspense> |
| 41 | </React.StrictMode> |
| 42 | ) |
| 43 | } |