import { useEffect } from 'react'; import { Viewer, DocumentGate } from '@embedpdf/react/runtime'; import type { OpenInput } from '@embedpdf/react/runtime'; import { Stage, stagePlugin, useStage } from '@embedpdf/react/stage'; import { RenderLayer, renderPlugin } from '@embedpdf/react/render'; import { SearchLayer, searchPlugin, useSearch, useSearchHits } from '@embedpdf/react/search'; import { cloudEngine } from '@cloudpdf/engine'; import './pass-through.css'; const engine = cloudEngine(); const plugins = [stagePlugin(), renderPlugin(), searchPlugin()]; const welcome: OpenInput = { kind: 'grant', grant: 'shr_gvpJcG1ULUMon19C0D1wODSY' }; // A search hit says where it is in page coordinates; the Stage takes them as they are. function Hits() { const search = useSearch(); const stage = useStage(); const hits = useSearchHits(); useEffect(() => { void search.search({ text: 'PDF' }); }, [search]); return (
    {hits.slice(0, 8).map((hit) => hit.bounds ? (
  1. ) : null, )}
); } export default function App() { return ( Loading…

}>
{() => ( <> )}
); }