import Link from "next/link";

type ClientCardProps = {
  id: string;
  name: string;
  email: string;
  docCount: number;
  lastActivity: Date | null;
};

export function ClientCard({
  id,
  name,
  email,
  docCount,
  lastActivity,
}: ClientCardProps) {
  return (
    <Link href={"/portal/clients/" + id}>
      <div className="bg-white rounded-xl shadow-sm p-5 hover:shadow-md transition-shadow cursor-pointer">
        <p className="text-[var(--navy)] font-semibold text-base">{name}</p>
        <p className="text-gray-500 text-sm mt-1">{email}</p>
        <p className="text-gray-400 text-xs mt-3">
          Documents: {docCount}
        </p>
        <p className="text-gray-400 text-xs mt-1">
          Last activity:{" "}
          {lastActivity
            ? lastActivity.toLocaleDateString("en-US", {
                month: "short",
                day: "numeric",
                year: "numeric",
              })
            : "No activity yet"}
        </p>
      </div>
    </Link>
  );
}
