Fixed typos and added pptx preview for frontend (#12577)

### What problem does this PR solve?
Previously, we added support for previewing PPT and PPTX files in the
backend. Now, we are adding it to the frontend, so when the slides in
the chat interface are referenced, they will no longer be blank.
### Type of change

- Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
LIRUI YU
2026-01-13 17:02:36 +08:00
committed by GitHub
parent 34d74d9928
commit 947e63ca14
3 changed files with 7 additions and 2 deletions

View File

@ -88,7 +88,7 @@ CONTENT_TYPE_MAP = {
"heic": "image/heic",
# PPTX
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation",
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
}

View File

@ -67,7 +67,7 @@ const Preview = ({
<VideoPreviewer className={className} url={url} />
</section>
)}
{['pptx'].indexOf(fileType) > -1 && (
{['ppt', 'pptx'].indexOf(fileType) > -1 && (
<section>
<PptPreviewer className={className} url={url} />
</section>

View File

@ -13,6 +13,7 @@ import { ExcelCsvPreviewer } from '@/components/document-preview/excel-preview';
import { ImagePreviewer } from '@/components/document-preview/image-preview';
import Md from '@/components/document-preview/md';
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 styles from './index.less';
@ -53,6 +54,10 @@ const DocumentViewer = () => {
)}
{ext === 'docx' && <DocPreviewer url={api}></DocPreviewer>}
{(ext === 'ppt' || ext === 'pptx') && (
<PptPreviewer url={api} className="!h-dvh p-5"></PptPreviewer>
)}
</section>
);
};