"use client"; import React from "react"; import { cn } from "@/utils/cn"; import { TrendingUp, TrendingDown } from "lucide-react"; interface StatCardProps { label: string; value: string | number; change?: number; // Percentage change suffix?: string; prefix?: string; icon?: React.ReactNode; trend?: "up" | "down" | "neutral"; className?: string; } export function StatCard({ label, value, change, suffix, prefix, icon, trend, className, }: StatCardProps) { const trendColor = trend === "up" ? "text-green-600" : trend === "down" ? "text-red-600" : "text-black-alpha-64"; const trendBg = trend === "up" ? "bg-green-50" : trend === "down" ? "bg-red-50" : "bg-black-alpha-4"; return (

{label}

{icon &&
{icon}
}
{prefix && ( {prefix} )} {value} {suffix && ( {suffix} )}
{(change !== undefined || trend) && (
{trend && (
{trend === "up" ? ( ) : trend === "down" ? ( ) : null}
)} {change !== undefined && ( {change > 0 && "+"} {change}% )}
)}
); }