-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterlinearizer.web-view.tsx
More file actions
36 lines (35 loc) · 1.27 KB
/
interlinearizer.web-view.tsx
File metadata and controls
36 lines (35 loc) · 1.27 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
import type { WebViewProps } from '@papi/core';
import InterlinearizerLoader from './components/InterlinearizerLoader';
/**
* Root WebView component for the Interlinearizer.
*
* @param props - WebView props injected by the PAPI host
* @param props.projectId - PAPI project ID passed from the host; undefined when the WebView is
* opened outside a project context
* @param props.useWebViewScrollGroupScrRef - Hook that exposes the shared scroll-group scripture
* reference and its setter
* @param props.useWebViewState - Hook for reading and writing values persisted in the WebView's
* saved state (survives tab restores)
* @returns The full interlinearizer WebView layout
*/
globalThis.webViewComponent = function InterlinearizerWebView({
projectId,
useWebViewScrollGroupScrRef,
useWebViewState,
}: WebViewProps) {
return (
<div className="tw:flex tw:flex-col tw:h-full">
{projectId ? (
<InterlinearizerLoader
projectId={projectId}
useWebViewScrollGroupScrRef={useWebViewScrollGroupScrRef}
useWebViewState={useWebViewState}
/>
) : (
<p className="tw:text-sm tw:text-muted-foreground">
Open this WebView from a Paratext project to load its source book.
</p>
)}
</div>
);
};