import { ReactNode } from "react";
import { Inbox } from "lucide-react";

export function EmptyState({
  icon: Icon = Inbox,
  title,
  description,
  action,
}: {
  icon?: typeof Inbox;
  title: string;
  description?: string;
  action?: ReactNode;
}) {
  return (
    <div className="flex flex-col items-center justify-center px-6 py-14 text-center">
      <div className="relative mb-5">
        {/* Soft layered illustration */}
        <svg width="120" height="92" viewBox="0 0 120 92" fill="none" aria-hidden="true">
          <ellipse cx="60" cy="82" rx="48" ry="6" fill="currentColor" className="text-muted" opacity="0.6" />
          <rect x="22" y="20" width="76" height="52" rx="6" fill="currentColor" className="text-muted" />
          <rect x="30" y="28" width="60" height="6" rx="2" fill="currentColor" className="text-background" />
          <rect x="30" y="40" width="44" height="4" rx="2" fill="currentColor" className="text-background" opacity="0.7" />
          <rect x="30" y="50" width="52" height="4" rx="2" fill="currentColor" className="text-background" opacity="0.5" />
          <rect x="30" y="60" width="36" height="4" rx="2" fill="currentColor" className="text-background" opacity="0.4" />
        </svg>
        <div className="absolute -right-2 -top-2 grid h-10 w-10 place-items-center rounded-full bg-primary/10 text-primary shadow-sm">
          <Icon className="h-5 w-5" />
        </div>
      </div>
      <h3 className="text-base font-semibold text-foreground">{title}</h3>
      {description && <p className="mt-1 max-w-sm text-sm text-muted-foreground">{description}</p>}
      {action && <div className="mt-4">{action}</div>}
    </div>
  );
}
