"use client"; import { Card, CardContent } from "@/components/ui/card"; import { LucideIcon } from "lucide-react"; interface StatCardData { label: string; sublabel?: string; value: string | number; icon?: LucideIcon; iconColor?: string; trend?: { value: string; isPositive: boolean; }; onClick?: () => void; isActive?: boolean; } interface StatCardsProps { stats: StatCardData[]; } export function StatCards({ stats }: StatCardsProps) { const count = stats.length; const gridClass = count >= 5 ? 'grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-2' : 'grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2'; return (
{stats.map((stat, index) => { const Icon = stat.icon; const isClickable = !!stat.onClick; return (

{stat.label} {stat.sublabel && ( {stat.sublabel} )}

{stat.value}

{stat.trend && (

{stat.trend.value}

)}
{Icon && ( )}
); })}
); }