interface StatCard { label: string; value: string; sub: { type: "trend" | "stable" | "live"; text: string; color?: string }; icon: string; iconBg: string; iconColor: string; } interface ServiceStatsCardsProps { totalSent: number; successRate: number; deviceCount: number; todaySent: number; } export default function ServiceStatsCards({ totalSent, successRate, deviceCount, todaySent, }: ServiceStatsCardsProps) { const cards: StatCard[] = [ { label: "총 발송 수", value: totalSent.toLocaleString(), sub: { type: "trend", text: "+12.5%", color: "text-indigo-600" }, icon: "equalizer", iconBg: "bg-indigo-50", iconColor: "text-indigo-600", }, { label: "성공률", value: `${successRate}%`, sub: { type: "stable", text: "Stable" }, icon: "check_circle", iconBg: "bg-emerald-50", iconColor: "text-emerald-600", }, { label: "등록 기기 수", value: deviceCount.toLocaleString(), sub: { type: "trend", text: "+82 today", color: "text-amber-600" }, icon: "devices", iconBg: "bg-amber-50", iconColor: "text-amber-600", }, { label: "오늘 발송", value: todaySent.toLocaleString(), sub: { type: "live", text: "Live" }, icon: "today", iconBg: "bg-[#2563EB]/5", iconColor: "text-[#2563EB]", }, ]; return (
{card.label}
{card.value}
trending_up {card.sub.text}
)} {card.sub.type === "stable" && ({card.sub.text}
)} {card.sub.type === "live" && ({card.sub.text}
)}