"use client"; import Image from "next/image"; import { Card, CardBody } from "@heroui/react"; interface StatData { label: string; value: string; change: string; isPositive: boolean; } interface StatsCardsProps { stats?: StatData[]; } export default function StatsCards({ stats = [] }: StatsCardsProps) { if (!stats || stats.length === 0) { return null; } return (
{stats.map((stat, index) => { const isLastCard = index === stats.length - 1; const isFirstCard = index === 0; const valueColor = isLastCard && stat.value === "--" ? "text-green-500" : "text-text-primary dark:text-white"; return ( {/* Header with label and change badge */}
{stat.label}
{stat.change}
{/* Value */}
{stat.value}
); })}
); }