balibabu
commited on
Commit
·
cf3a5c1
1
Parent(s):
fda6678
feat: set local path of workerSrc to PdfLoader (#101)
Browse files
web/public/pdfjs-dist/pdf.worker.min.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
web/src/components/pdf-previewer/index.tsx
CHANGED
|
@@ -54,7 +54,11 @@ const DocumentPreviewer = ({ chunk, documentId, visible }: IProps) => {
|
|
| 54 |
|
| 55 |
return (
|
| 56 |
<div className={styles.documentContainer}>
|
| 57 |
-
<PdfLoader
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
{(pdfDocument) => (
|
| 59 |
<PdfHighlighter
|
| 60 |
pdfDocument={pdfDocument}
|
|
|
|
| 54 |
|
| 55 |
return (
|
| 56 |
<div className={styles.documentContainer}>
|
| 57 |
+
<PdfLoader
|
| 58 |
+
url={url}
|
| 59 |
+
beforeLoad={<Skeleton active />}
|
| 60 |
+
workerSrc="/pdfjs-dist/pdf.worker.min.js"
|
| 61 |
+
>
|
| 62 |
{(pdfDocument) => (
|
| 63 |
<PdfHighlighter
|
| 64 |
pdfDocument={pdfDocument}
|
web/src/pages/add-knowledge/components/knowledge-chunk/components/document-preview/preview.tsx
CHANGED
|
@@ -43,7 +43,11 @@ const Preview = ({ selectedChunkId }: IProps) => {
|
|
| 43 |
|
| 44 |
return (
|
| 45 |
<div className={styles.documentContainer}>
|
| 46 |
-
<PdfLoader
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
{(pdfDocument) => (
|
| 48 |
<PdfHighlighter
|
| 49 |
pdfDocument={pdfDocument}
|
|
|
|
| 43 |
|
| 44 |
return (
|
| 45 |
<div className={styles.documentContainer}>
|
| 46 |
+
<PdfLoader
|
| 47 |
+
url={url}
|
| 48 |
+
beforeLoad={<Skeleton active />}
|
| 49 |
+
workerSrc="/pdfjs-dist/pdf.worker.min.js"
|
| 50 |
+
>
|
| 51 |
{(pdfDocument) => (
|
| 52 |
<PdfHighlighter
|
| 53 |
pdfDocument={pdfDocument}
|