fix: display specific error message when previewing file error #868 (#869)

### What problem does this PR solve?

fix: display specific error message when previewing file error  #868


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-05-22 11:54:32 +08:00
committed by GitHub
parent 3cae87a902
commit b62a20816e
4 changed files with 39 additions and 17 deletions

View File

@ -5,7 +5,7 @@ import { useFetchDocx } from '../hooks';
import styles from './index.less';
const Docx = ({ filePath }: { filePath: string }) => {
const { succeed, containerRef } = useFetchDocx(filePath);
const { succeed, containerRef, error } = useFetchDocx(filePath);
return (
<>
@ -16,7 +16,7 @@ const Docx = ({ filePath }: { filePath: string }) => {
</div>
</section>
) : (
<FileError></FileError>
<FileError>{error}</FileError>
)}
</>
);