import { Inbox } from "lucide-react";

import { Button } from "@/components/ui/button";

interface EmptyStateProps {
  title: string;
  description: string;
  icon?: React.ComponentType<{ className?: string }>;
  actionLabel?: string;
  onAction?: () => void;
}

export function EmptyState({
  title,
  description,
  icon: Icon = Inbox,
  actionLabel,
  onAction
}: EmptyStateProps) {
  return (
    <section className="glass-panel panel-elevated rounded-2xl border border-dashed border-white/20 p-6 text-center" role="status" aria-live="polite">
      <span className="mx-auto inline-flex size-11 items-center justify-center rounded-xl border border-white/15 bg-white/5">
        <Icon className="size-6 text-slate-300" />
      </span>
      <h3 className="mt-3 text-lg font-medium text-white">{title}</h3>
      <p className="mx-auto mt-2 max-w-2xl text-sm text-slate-400">{description}</p>
      {actionLabel && onAction ? (
        <Button className="mt-4 focus-visible:ring-sky-300/60" variant="secondary" size="sm" onClick={onAction}>
          {actionLabel}
        </Button>
      ) : null}
    </section>
  );
}
