mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-19 12:06:42 +08:00
feat: delete the added model #503 and display an error message when the requested file fails to parse #684 (#708)
### What problem does this PR solve? feat: delete the added model #503 feat: display an error message when the requested file fails to parse #684 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { Skeleton } from 'antd';
|
||||
import { PdfHighlighter, PdfLoader } from 'react-pdf-highlighter';
|
||||
import FileError from '../file-error';
|
||||
|
||||
interface IProps {
|
||||
url: string;
|
||||
@ -9,11 +10,15 @@ const DocumentPreviewer = ({ url }: IProps) => {
|
||||
const resetHash = () => {};
|
||||
|
||||
return (
|
||||
<div style={{ width: '100%' }}>
|
||||
<div style={{ width: '100%', height: '100%' }}>
|
||||
<PdfLoader
|
||||
url={url}
|
||||
beforeLoad={<Skeleton active />}
|
||||
workerSrc="/pdfjs-dist/pdf.worker.min.js"
|
||||
errorMessage={<FileError></FileError>}
|
||||
onError={(e) => {
|
||||
console.warn(e);
|
||||
}}
|
||||
>
|
||||
{(pdfDocument) => {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user