import type { LucideIcon } from "lucide-react"; import type { ReactNode } from "react"; import { Link } from "@/lib/router"; interface MetricCardProps { icon: LucideIcon; value: string | number; label: string; description?: ReactNode; to?: string; onClick?: () => void; } export function MetricCard({ icon: Icon, value, label, description, to, onClick }: MetricCardProps) { const isClickable = !!(to || onClick); const inner = (

{value}

{label}

{description && (
{description}
)}
); if (to) { return ( {inner} ); } if (onClick) { return (
{inner}
); } return inner; }