import { Viewer, DocumentGate, DocumentScope, useDocument, useDocumentsState, } from '@embedpdf/react/runtime'; import type { OpenInput } from '@embedpdf/react/runtime'; import { Stage, stagePlugin, useStage, useStageState } from '@embedpdf/react/stage'; import { RenderLayer, renderPlugin } from '@embedpdf/react/render'; import { cloudEngine } from '@cloudpdf/engine'; import './scope.css'; const engine = cloudEngine(); const plugins = [stagePlugin(), renderPlugin()]; const welcome: OpenInput = { kind: 'grant', grant: 'shr_gvpJcG1ULUMon19C0D1wODSY' }; const article: OpenInput = { kind: 'grant', grant: 'shr_v09cJHOmj3C8vrfUlZNTDyqX' }; // The same component in both panes: each talks to the document its names. function Header() { const { name, pageCount } = useDocument(); const stage = useStage(); const zoomLevel = useStageState((state) => state.zoomLevel); return (
{name} {pageCount} pages {Math.round(zoomLevel * 100)}%
); } function SideBySide() { const { documents } = useDocumentsState(); return (
{documents.map((document) => (
Opening…

}>
{() => }
))}
); } export default function App() { return ( ); }