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

@ -3,7 +3,7 @@ import FileError from '../file-error';
import { useFetchExcel } from '../hooks';
const Excel = ({ filePath }: { filePath: string }) => {
const { status, containerRef } = useFetchExcel(filePath);
const { status, containerRef, error } = useFetchExcel(filePath);
return (
<div
@ -11,7 +11,7 @@ const Excel = ({ filePath }: { filePath: string }) => {
ref={containerRef}
style={{ height: '100%', width: '100%' }}
>
{status || <FileError></FileError>}
{status || <FileError>{error}</FileError>}
</div>
);
};