forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-72-Lilly-Protocol-lily-frontend.tsx
More file actions
40 lines (38 loc) · 1.3 KB
/
Copy pathgithub-72-Lilly-Protocol-lily-frontend.tsx
File metadata and controls
40 lines (38 loc) · 1.3 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
import { ReactNode } from 'react';
import { PlusIcon } from '@heroicons/react/24/outline';
interface EmptyStateProps {
icon?: ReactNode;
title: string;
description?: string;
actionLabel?: string;
onAction?: () => void;
className?: string;
}
export default function EmptyState({
icon = <PlusIcon className="h-12 w-12 text-gray-400 dark:text-gray-500" />,
title,
description,
actionLabel = 'Create New',
onAction,
className = '',
}: EmptyStateProps) {
return (
<div className={`flex flex-col items-center justify-center py-16 px-4 text-center ${className}`}>
<div className="mb-4 flex h-20 w-20 items-center justify-center rounded-full bg-gray-50 dark:bg-gray-800">
{icon}
</div>
<h3 className="text-lg font-semibold text-gray-900 dark:text-gray-100">{title}</h3>
{description && (
<p className="mt-2 max-w-md text-sm text-gray-500 dark:text-gray-400">{description}</p>
)}
{onAction && (
<button
onClick={onAction}
className="mt-6 rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900 transition-colors"
>
{actionLabel}
</button>
)}
</div>
);
}