Fix bugs: office auth, PDF worker, sidebar pins, direct downloads
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m0s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m0s
This commit is contained in:
parent
e88243f097
commit
bfe55e2bfc
6 changed files with 74 additions and 32 deletions
|
|
@ -7,7 +7,7 @@ import 'react-pdf/dist/Page/AnnotationLayer.css';
|
|||
import 'react-pdf/dist/Page/TextLayer.css';
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = `/pdf.worker.min.mjs`;
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
|
||||
}
|
||||
|
||||
export default function PdfViewer({ url }: { url: string }) {
|
||||
|
|
@ -53,6 +53,7 @@ export default function PdfViewer({ url }: { url: string }) {
|
|||
<Document
|
||||
file={url}
|
||||
onLoadSuccess={onDocumentLoadSuccess}
|
||||
onLoadError={(error) => console.error('Failed to load PDF:', error)}
|
||||
loading={
|
||||
<div className="flex items-center justify-center h-full mt-20">
|
||||
<Loader2 className="w-8 h-8 animate-spin" style={{ color: 'var(--color-accent)' }} />
|
||||
|
|
|
|||
Reference in a new issue