mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-04 14:50:30 +08:00
### 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)
20 lines
455 B
TypeScript
20 lines
455 B
TypeScript
import '@js-preview/excel/lib/index.css';
|
|
import FileError from '../file-error';
|
|
import { useFetchExcel } from '../hooks';
|
|
|
|
const Excel = ({ filePath }: { filePath: string }) => {
|
|
const { status, containerRef, error } = useFetchExcel(filePath);
|
|
|
|
return (
|
|
<div
|
|
id="excel"
|
|
ref={containerRef}
|
|
style={{ height: '100%', width: '100%' }}
|
|
>
|
|
{status || <FileError>{error}</FileError>}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Excel;
|