feat: add page numbers to documents (#946)

This commit is contained in:
Ephraim Duncan
2024-02-22 05:36:34 +00:00
committed by GitHub
parent df132a51ab
commit a48bda0d27

View File

@ -233,18 +233,20 @@ export const PDFViewer = ({
{Array(numPages) {Array(numPages)
.fill(null) .fill(null)
.map((_, i) => ( .map((_, i) => (
<div <div key={i} className="last:-mb-2">
key={i} <div className="border-border overflow-hidden rounded border will-change-transform">
className="border-border my-8 overflow-hidden rounded border will-change-transform first:mt-0 last:mb-0" <PDFPage
> pageNumber={i + 1}
<PDFPage width={width}
pageNumber={i + 1} renderAnnotationLayer={false}
width={width} renderTextLayer={false}
renderAnnotationLayer={false} loading={() => ''}
renderTextLayer={false} onClick={(e) => onDocumentPageClick(e, i + 1)}
loading={() => ''} />
onClick={(e) => onDocumentPageClick(e, i + 1)} </div>
/> <p className="text-muted-foreground/80 my-2 text-center text-[11px]">
Page {i + 1} of {numPages}
</p>
</div> </div>
))} ))}
</PDFDocument> </PDFDocument>