import Link from "next/link"

export default function Card({
  title,
  total,
  icon,
  href,
}: {
  title: string
  total: number
  icon: React.ReactNode
  href: string
}) {
  return (
    <Link href={href} passHref>
      <div className="rounded-lg border bg-white p-6 shadow-sm transition-shadow hover:shadow">
        <div className="flex items-center">
          <div className="mr-4">{icon}</div>
          <div>
            <h3 className="text-lg font-medium">{title}</h3>
            <p className="text-muted-foreground mt-2 text-sm">Total: {total}</p>
          </div>
        </div>
      </div>
    </Link>
  )
}
