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
| 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';
|
| const NotFound = ({ children, onClick, btnMsg }) => {
| const navigate = useNavigate();
|
| 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
| }}>
| Data Empty
| </Typography>
| <Typography variant="subtitle1" gutterBottom sx={{
| fontSize: '1em',
| opacity: .5,
| mt: 2
| }}>
| Please Create Data First
| </Typography>
| {children}
| {!children && (
| <Button
| variant="contained"
| color="primary"
| onClick={onClick}
| sx={{
| fontSize: '1em',
| mt: 2
| }}
| >
| {btnMsg || 'Create Data'}
| </Button>
| )}
| </Box>
| );
| };
|
| export default NotFound;
|
|