Spaces:
Running
Running
| import React from "react"; | |
| import { Button } from "@/components/ui/button"; | |
| import { LucideIcon } from "lucide-react"; | |
| interface EmptyStateProps { | |
| icon: LucideIcon; | |
| title: string; | |
| description: string; | |
| action?: { | |
| label: string; | |
| onClick: () => void; | |
| variant?: "default" | "outline" | "secondary"; | |
| }; | |
| children?: React.ReactNode; | |
| } | |
| export function EmptyState({ | |
| icon: Icon, | |
| title, | |
| description, | |
| action, | |
| children, | |
| }: EmptyStateProps) { | |
| return ( | |
| <div className="flex flex-col items-center justify-center p-12 text-center"> | |
| <div className="flex items-center justify-center w-16 h-16 mb-6 rounded-full bg-muted/30"> | |
| <Icon className="h-8 w-8 text-muted-foreground" /> | |
| </div> | |
| <h3 className="text-lg font-semibold mb-2 text-foreground">{title}</h3> | |
| <p className="text-muted-foreground mb-6 max-w-sm leading-relaxed"> | |
| {description} | |
| </p> | |
| {action && ( | |
| <Button | |
| onClick={action.onClick} | |
| variant={action.variant || "default"} | |
| className="mb-4" | |
| > | |
| {action.label} | |
| </Button> | |
| )} | |
| {children} | |
| </div> | |
| ); | |
| } | |