EmptyState.tsx 837 B

1234567891011121314151617181920212223242526272829
  1. import type { LucideIcon } from "lucide-react";
  2. import { Button } from "@/components/ui/button";
  3. export function EmptyState({
  4. icon: Icon,
  5. title,
  6. description,
  7. actionLabel,
  8. onAction,
  9. }: {
  10. icon: LucideIcon;
  11. title: string;
  12. description: string;
  13. actionLabel?: string;
  14. onAction?: () => void;
  15. }) {
  16. return (
  17. <div className="flex min-h-64 flex-col items-center justify-center rounded-md border border-dashed border-border bg-muted/30 p-8 text-center">
  18. <Icon className="h-9 w-9 text-muted-foreground" />
  19. <h3 className="mt-4 text-base font-semibold">{title}</h3>
  20. <p className="mt-2 max-w-md text-sm text-muted-foreground">{description}</p>
  21. {actionLabel && onAction ? (
  22. <Button className="mt-5" onClick={onAction}>
  23. {actionLabel}
  24. </Button>
  25. ) : null}
  26. </div>
  27. );
  28. }