43 lines
941 B
TypeScript
43 lines
941 B
TypeScript
import { cn } from '../../utils/helpers';
|
|
import { LucideIcon } from 'lucide-react';
|
|
|
|
interface EmptyStateProps {
|
|
icon?: LucideIcon;
|
|
title: string;
|
|
description?: string;
|
|
action?: React.ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export function EmptyState({
|
|
icon: Icon,
|
|
title,
|
|
description,
|
|
action,
|
|
className,
|
|
}: EmptyStateProps) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
'flex flex-col items-center justify-center py-12 text-center',
|
|
className
|
|
)}
|
|
>
|
|
{Icon && (
|
|
<div className="mb-4 rounded-full bg-muted p-4">
|
|
<Icon className="h-8 w-8 text-muted-foreground" />
|
|
</div>
|
|
)}
|
|
<h3 className="text-lg font-semibold">{title}</h3>
|
|
{description && (
|
|
<p className="mt-2 max-w-sm text-sm text-muted-foreground">
|
|
{description}
|
|
</p>
|
|
)}
|
|
{action && <div className="mt-6">{action}</div>}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default EmptyState;
|