import { StatCardProps } from "@/constants/types"; import { colorMap } from "@/constants/constant"; export default function StatCard({ title, value, variant = "progress", subtitle, progress, color = "teal", icon: Icon, badgeText, badgeClassName = "text-slate-500 font-mono uppercase", iconContainerClassName = "bg-[#11233a] border-[#1b2c3f]/50 text-cyan-400", isActiveCard = false, }: StatCardProps) { // Base structural classes matched exactly to your dark UI design const cardBorder = isActiveCard ? "border-[#0d9488]" : "border-[#142538]"; return (
{/* --- TOP HEADER SECTION --- */}
{variant === "icon" && Icon ? (
) : ( {title} )} {badgeText && ( {badgeText} )}
{/* --- BODY STATS SECTION --- */}
{value}
{/* Subtitle / Bottom Label text arrangement layout swap */}

{variant === "icon" ? title : subtitle}

{/* --- PROGRESS LAYER (Only renders if variant="progress") --- */} {variant === "progress" && progress !== undefined && (
)}
); }