forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgh-disc-72-Lilly-Protocol-lily-frontend.tsx
More file actions
71 lines (68 loc) · 1.6 KB
/
Copy pathgh-disc-72-Lilly-Protocol-lily-frontend.tsx
File metadata and controls
71 lines (68 loc) · 1.6 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import React from 'react';
import { Box, Typography, Button, SxProps, Theme } from '@mui/material';
import { Add as AddIcon } from '@mui/icons-material';
interface EmptyStateProps {
title?: string;
description?: string;
actionLabel?: string;
onAction?: () => void;
sx?: SxProps<Theme>;
}
const EmptyState: React.FC<EmptyStateProps> = ({
title = 'No items found',
description = 'There are no items to display. Try adjusting your filters or add a new item.',
actionLabel,
onAction,
sx,
}) => {
return (
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
textAlign="center"
py={8}
px={4}
sx={{
color: 'text.secondary',
...sx,
}}
>
<Box
component="svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
sx={{
width: 64,
height: 64,
mb: 3,
opacity: 0.6,
}}
>
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
</Box>
<Typography variant="h6" gutterBottom>
{title}
</Typography>
<Typography variant="body2" sx={{ mb: 3, maxWidth: 400 }}>
{description}
</Typography>
{actionLabel && onAction && (
<Button
variant="contained"
startIcon={<AddIcon />}
onClick={onAction}
size="medium"
>
{actionLabel}
</Button>
)}
</Box>
);
};
export default EmptyState;