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 { localEngine } from '@embedpdf/engine';
import './state.css';
const engine = localEngine();
const plugins = [stagePlugin(), renderPlugin(), interactionPlugin(), selectionPlugin()];
const welcome = async (): Promise
);
}
// Something selected on load: "Documents", the first word on the cover.
function SelectTitle() {
const selection = useSelection();
const cover = usePageList()[0]?.ref;
useEffect(() => {
if (cover) selection.select({ page: cover, start: 28, count: 9 });
}, [selection, cover]);
return null;
}
export default function App() {
return (