skyouc
7 天以前 b9d414bc2d61b4824ce6a019b1c10f526f71ced1
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { LinearProgress, Stack, Typography } from '@mui/material';
import { CreateButton, useGetList } from 'react-admin';
import useAppBarHeight from './useAppBarHeight';
import { matchPath, useLocation } from 'react-router';
import { Link } from 'react-router-dom';
 
const EmptyDataLoader = ({ children }) => {
    const location = useLocation();
    const matchCreate = matchPath('/mission/create', location.pathname);
    const appBarHeight = useAppBarHeight();
 
    return (
        <Stack
            justifyContent="center"
            alignItems="center"
            gap={3}
            sx={{
                height: `calc(100dvh - ${appBarHeight}px)`,
            }}
        >
            <img src="/empty.svg" alt="No contacts found" />
            <Stack gap={0} alignItems="center">
                <Typography variant="h6" fontWeight="bold">
                    No data found
                </Typography>
                <Typography
                    variant="body2"
                    align="center"
                    color="text.secondary"
                    gutterBottom
                >
                    It seems your server data is empty.
                    <br />
                    {children}
                </Typography>
            </Stack>
        </Stack>
    );
};
 
export default EmptyDataLoader;