import { useState } from 'react';
import { Viewer, DocumentGate } from '@embedpdf/react/runtime';
import type { OpenInput } from '@embedpdf/react/runtime';
import {
Stage,
stagePlugin,
useStage,
useStageSettings,
useStageState,
} from '@embedpdf/react/stage';
import { RenderLayer, renderPlugin } from '@embedpdf/react/render';
import { localEngine } from '@embedpdf/engine';
import './responsive.css';
const engine = localEngine();
// Facing pages with a roomy margin, and one rule for a narrow Stage: a thin
// margin and one page at a time. The rule has a name, so the UI can read it too.
const plugins = [
stagePlugin({
padding: 24,
spread: 'odd',
responsive: [
{ name: 'compact', when: { maxWidth: 600 }, settings: { padding: 4, spread: 'none' } },
],
}),
renderPlugin(),
];
const welcome = async (): Promise