We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc9ee89 commit c809a80Copy full SHA for c809a80
templates/types/streaming/nextjs/app/components/ui/chat/widgets/PdfDialog.tsx
@@ -1,4 +1,4 @@
1
-import { PDFViewer, PdfFocusProvider } from "@llamaindex/pdf-viewer";
+import dynamic from "next/dynamic";
2
import { Button } from "../../button";
3
import {
4
Drawer,
@@ -16,6 +16,18 @@ export interface PdfDialogProps {
16
trigger: React.ReactNode;
17
}
18
19
+// Dynamic imports for client-side rendering only
20
+const PDFViewer = dynamic(
21
+ () => import("@llamaindex/pdf-viewer").then((module) => module.PDFViewer),
22
+ { ssr: false },
23
+);
24
+
25
+const PdfFocusProvider = dynamic(
26
+ () =>
27
+ import("@llamaindex/pdf-viewer").then((module) => module.PdfFocusProvider),
28
29
30
31
export default function PdfDialog(props: PdfDialogProps) {
32
return (
33
<Drawer direction="left">
0 commit comments