UNPKG

@llamaindex/ui

Version:

A comprehensive UI component library built with React, TypeScript, and Tailwind CSS for LlamaIndex applications

49 lines (46 loc) 1.22 kB
import { Clock } from 'lucide-react'; import { lazy, memo, Suspense } from 'react'; import { jsx, jsxs } from 'react/jsx-runtime'; // src/file-preview/pdf-preview.tsx var PdfPreviewLazy = lazy( () => import('./pdf-preview-impl-HJSFPJBS.mjs').then((module) => ({ default: module.PdfPreviewImpl })) ); var PdfPreview = memo( ({ url, highlights, fileName, toolbarClassName, onRemove, maxPages, maxPagesWarning }) => { if (typeof window === "undefined") { return null; } return /* @__PURE__ */ jsx( Suspense, { fallback: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center p-8", children: [ /* @__PURE__ */ jsx(Clock, { className: "h-6 w-6 animate-pulse text-gray-400" }), /* @__PURE__ */ jsx("span", { className: "ml-2 text-gray-600", children: "Loading PDF viewer..." }) ] }), children: /* @__PURE__ */ jsx( PdfPreviewLazy, { url, highlights, fileName, toolbarClassName, onRemove, maxPages, maxPagesWarning } ) } ); } ); export { PdfPreview };