import { useEffect } from 'react'; import { Viewer, DocumentGate, usePageList } from '@embedpdf/react/runtime'; import type { OpenInput } from '@embedpdf/react/runtime'; import { Stage, stagePlugin } from '@embedpdf/react/stage'; import { RenderLayer, renderPlugin } from '@embedpdf/react/render'; import { interactionPlugin } from '@embedpdf/react/interaction'; import { SelectionLayer, selectionPlugin, useSelection, useSelectionState, } from '@embedpdf/react/selection'; import { cloudEngine } from '@cloudpdf/engine'; import './state.css'; const engine = cloudEngine(); const plugins = [stagePlugin(), renderPlugin(), interactionPlugin(), selectionPlugin()]; const welcome: OpenInput = { kind: 'grant', grant: 'shr_gvpJcG1ULUMon19C0D1wODSY' }; // Every field of the selection's state, as it changes. function SelectionStatus() { const { hasSelection, isSelecting, range, pages } = useSelectionState(); return (