From cc0a7c2a5a6d3076f4098466a4ac049fea98910f Mon Sep 17 00:00:00 2001 From: hudy9x Date: Wed, 27 Mar 2024 16:56:01 +0700 Subject: [PATCH] fix(pdf-viewer): the viewer only show 1 page --- .../ui-app/app/_components/PdfViewer/index.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/ui-app/app/_components/PdfViewer/index.tsx b/packages/ui-app/app/_components/PdfViewer/index.tsx index b75ee533..00a8d203 100644 --- a/packages/ui-app/app/_components/PdfViewer/index.tsx +++ b/packages/ui-app/app/_components/PdfViewer/index.tsx @@ -16,14 +16,22 @@ export default function PdfViewer({ src }: { src: string }) { setLoading(false) } + const pages = new Array(numPages).fill(1).map((v, i) => i + 1) + return (
- - + + {pages.map(p => { + return + })} -

- Page {pageNumber} of {numPages} +

+ Total: {numPages} pages + {/* Page {pageNumber} of {numPages} */}

)