vincentlu
2025-02-05 9d79b8c8d34077ebf782a7b61d54ee4e1debdba1
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
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from 'react';
import { Button, Typography, Box, SvgIcon } from '@mui/material';
import { HotTub } from '@mui/icons-material';
import { useNavigate } from 'react-router-dom';
import MyCreateButton from './MyCreateButton';
import { useTranslate } from 'react-admin';
 
const NotFound = ({ children, onClick, btnMsg }) => {
    const navigate = useNavigate();
    const translate = useTranslate();
    return (
        <Box
            display="flex"
            flexDirection="column"
            alignItems="center"
            justifyContent="flex-start"
            height="100vh"
            pt={10}
        >
            <SvgIcon component={HotTub} sx={{ fontSize: '18em', mb: 2, opacity: .5 }} />
            <Typography variant="h1" gutterBottom sx={{
                fontWeight: 'bold',
                fontSize: '2em',
                opacity: .5,
                mt: 2
            }}>
                {translate('create.empty.title')}
            </Typography>
            <Typography variant="subtitle1" gutterBottom sx={{
                fontSize: '1em',
                opacity: .5,
                mt: 2
            }}>
                {translate('create.empty.desc')}
            </Typography>
            {children}
            {!children && (
                <Button
                    variant="contained"
                    color="primary"
                    onClick={onClick}
                    sx={{
                        fontSize: '1em',
                        mt: 2
                    }}
                >
                    {btnMsg || translate('create.empty.button')}
                </Button>
            )}
        </Box>
    );
};
 
export default NotFound;