import Link from "next/link";
import type { ReactNode } from "react";

type EmptyStateProps = {
  title: string;
  description?: string;
  action?: { href: string; label: string };
  icon?: ReactNode;
};

export function EmptyState({ title, description, action, icon }: EmptyStateProps) {
  return (
    <div className="flex flex-col items-center justify-center gap-2 rounded-2xl border border-dashed border-white/10 px-6 py-10 text-center">
      {icon ? <div className="text-fg/40">{icon}</div> : null}
      <div className="text-base font-semibold text-fg">{title}</div>
      {description ? <p className="max-w-sm text-sm text-fg/60">{description}</p> : null}
      {action ? (
        <Link
          href={action.href}
          className="btn btn-primary mt-2"
        >
          {action.label}
        </Link>
      ) : null}
    </div>
  );
}
