File size: 584 Bytes
ebf2bde 8dff6d9 ebf2bde 8dff6d9 ebf2bde |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import { Spin } from 'antd';
import FileError from '../file-error';
import { useFetchDocx } from '../hooks';
import styles from './index.less';
const Docx = ({ filePath }: { filePath: string }) => {
const { succeed, containerRef, error } = useFetchDocx(filePath);
return (
<>
{succeed ? (
<section className={styles.docxViewerWrapper}>
<div id="docx" ref={containerRef} className={styles.box}>
<Spin />
</div>
</section>
) : (
<FileError>{error}</FileError>
)}
</>
);
};
export default Docx;
|