123456789101112131415161718192021 |
- import React, { useEffect, useState } from 'react';
- import PdfSkeleton from '../components/PdfSkeleton';
- import useStore from '../store';
- import { delay } from '../helpers/time';
- const Placeholder: React.FC = () => {
- const [{ progress }] = useStore();
- const [done, setDone] = useState(false);
- useEffect(() => {
- delay(1200).then(() => {
- setDone(true);
- });
- }, []);
- return progress.loaded < progress.total || !done ? <PdfSkeleton /> : null;
- };
- export default Placeholder;
|