mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-07 16:11:16 +08:00
feat: add more file type preview support in document viewer (#17872)
This commit is contained in:
@@ -199,6 +199,9 @@ export const ExceptiveType = [
|
||||
'docx',
|
||||
'md',
|
||||
'mdx',
|
||||
'txt',
|
||||
'csv',
|
||||
'pptx',
|
||||
...Images,
|
||||
];
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import PdfPreview from '@/components/document-preview/pdf-preview';
|
||||
import { PptPreviewer } from '@/components/document-preview/ppt-preview';
|
||||
import { TxtPreviewer } from '@/components/document-preview/txt-preview';
|
||||
import { previewHtmlFile } from '@/utils/file-util';
|
||||
import CSVFileViewer from '@/components/document-preview/csv-preview';
|
||||
// import styles from './index.less';
|
||||
|
||||
// TODO: The interface returns an incorrect content-type for the SVG.
|
||||
@@ -56,6 +57,11 @@ const DocumentViewer = () => {
|
||||
{(ext === 'xlsx' || ext === 'xls') && (
|
||||
<ExcelCsvPreviewer url={api}></ExcelCsvPreviewer>
|
||||
)}
|
||||
{ext === 'csv' && (
|
||||
<section className="m-1">
|
||||
<CSVFileViewer url={api} />
|
||||
</section>
|
||||
)}
|
||||
|
||||
{ext === 'docx' && <DocPreviewer url={api}></DocPreviewer>}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user