source: src/components/empty-content/empty-content.tsx@ 5d6f37a

main
Last change on this file since 5d6f37a was 5d6f37a, checked in by Naum Shapkarovski <naumshapkarovski@…>, 7 weeks ago

add customer

  • Property mode set to 100644
File size: 1.5 KB
Line 
1// @mui
2import { alpha } from '@mui/material/styles';
3import Box from '@mui/material/Box';
4import Typography from '@mui/material/Typography';
5import Stack, { StackProps } from '@mui/material/Stack';
6
7// ----------------------------------------------------------------------
8
9type EmptyContentProps = StackProps & {
10 title?: string;
11 imgUrl?: string;
12 filled?: boolean;
13 description?: string;
14 action?: React.ReactNode;
15};
16
17export default function EmptyContent({
18 title,
19 imgUrl,
20 action,
21 filled,
22 description,
23 sx,
24 ...other
25}: EmptyContentProps) {
26 return (
27 <Stack
28 flexGrow={1}
29 alignItems="center"
30 justifyContent="center"
31 sx={{
32 px: 3,
33 height: 1,
34 ...(filled && {
35 borderRadius: 2,
36 bgcolor: (theme) => alpha(theme.palette.grey[500], 0.04),
37 border: (theme) => `dashed 1px ${alpha(theme.palette.grey[500], 0.08)}`,
38 }),
39 ...sx,
40 }}
41 {...other}
42 >
43 <Box
44 component="img"
45 alt="empty content"
46 src={imgUrl || '/assets/icons/empty/ic_content.svg'}
47 sx={{ width: 1, maxWidth: 160 }}
48 />
49
50 {title && (
51 <Typography
52 variant="h6"
53 component="span"
54 sx={{ mt: 1, color: 'text.disabled', textAlign: 'center' }}
55 >
56 {title}
57 </Typography>
58 )}
59
60 {description && (
61 <Typography variant="caption" sx={{ mt: 1, color: 'text.disabled', textAlign: 'center' }}>
62 {description}
63 </Typography>
64 )}
65
66 {action && action}
67 </Stack>
68 );
69}
Note: See TracBrowser for help on using the repository browser.