import { Viewer, DocumentGate } 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 { commandsPlugin, standardCommands, useCommand } from '@embedpdf/react/commands';
import { i18nPlugin, useI18n, useI18nState, useT } from '@embedpdf/react/i18n';
import type { Locale } from '@embedpdf/react/i18n';
import { localEngine } from '@embedpdf/engine';
import './rtl.css';
const engine = localEngine();
const en: Locale = {
code: 'en',
name: 'English',
translations: { app: { title: 'The guide', switchTo: 'العربية' } },
};
// Arabic reads right to left. The standard commands have no Arabic labels, so the app gives
// them, under the same keys.
const ar: Locale = {
code: 'ar',
name: 'العربية',
direction: 'rtl',
translations: {
app: { title: 'الدليل', switchTo: 'English' },
commands: {
page: { previous: 'الصفحة السابقة', next: 'الصفحة التالية' },
zoom: { in: 'تكبير', out: 'تصغير' },
},
},
};
const plugins = [
stagePlugin(),
renderPlugin(),
commandsPlugin({ commands: standardCommands }),
i18nPlugin({ locale: 'ar', locales: [en, ar] }),
];
const welcome = async (): Promise