import { Inbox } from "lucide-react";
import type { ReactNode } from "react";
import { cn } from "@/lib/utils";

type NoDataProps = {
  title?: string;
  message?: string;
  icon?: ReactNode;
  action?: ReactNode;
  className?: string;
};

export default function NoData({
  title = "No data found",
  message = "There is nothing to show here yet.",
  icon,
  action,
  className,
}: NoDataProps) {
  return (
    <div
      className={cn(
        "flex flex-col items-center justify-center text-center py-14 px-6 rounded-2xl border border-dashed border-gray-200 bg-gray-50",
        className
      )}
    >
      <div className="w-14 h-14 rounded-full bg-white border border-gray-100 flex items-center justify-center text-gray-400 mb-4">
        {icon || <Inbox size={26} />}
      </div>
      <h3 className="text-base font-semibold text-gray-900">{title}</h3>
      <p className="text-sm text-gray-500 mt-1 max-w-md">{message}</p>
      {action ? <div className="mt-5">{action}</div> : null}
    </div>
  );
}
