-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathemptystate_upstream.jsx
More file actions
68 lines (65 loc) · 1.94 KB
/
Copy pathemptystate_upstream.jsx
File metadata and controls
68 lines (65 loc) · 1.94 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
export function EmptyState({ icon, title, description, action, onAction, variant = 'default' }) {
return (
<div className={`empty-state empty-state--${variant}`}>
{icon && <div className="empty-state__icon">{icon}</div>}
<h3 className="empty-state__title">{title}</h3>
{description && <p className="empty-state__desc">{description}</p>}
{action && onAction && (
<button className="empty-state__btn" onClick={onAction}>
{action}
</button>
)}
</div>
);
}
export function NoResultsEmpty({ onClear }) {
return (
<EmptyState
icon={
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
<circle cx="11" cy="11" r="8" />
<path d="m21 21-4.35-4.35" />
<path d="M11 8v6M8 11h6" />
</svg>
}
title="No Results Found"
description="No results matched your search. Try different keywords."
action="Clear Filter"
onAction={onClear}
variant="search"
/>
);
}
export function EmptyListEmpty({ onAdd }) {
return (
<EmptyState
icon={
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
<path d="M12 5v14M5 12h14" />
</svg>
}
title="List is Empty"
description="Add your first item and get started."
action="+ Add Item"
onAction={onAdd}
variant="default"
/>
);
}
export function ErrorEmpty({ onRetry }) {
return (
<EmptyState
icon={
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
<circle cx="12" cy="12" r="10" />
<path d="M12 8v4M12 16h.01" />
</svg>
}
title="Something Went Wrong"
description="Failed to load data. Check your connection and try again."
action="Retry"
onAction={onRetry}
variant="error"
/>
);
}