/** * StatCard Component * Displays a statistic card with icon, title, and value */ import { LucideIcon } from 'lucide-react'; import { cn } from '@/lib/utils'; interface StatCardProps { title: string; value: string | number; icon: LucideIcon; description?: string; loading?: boolean; trend?: { value: number; label: string; isPositive?: boolean; }; className?: string; } export function StatCard({ title, value, icon: Icon, description, loading = false, trend, className, }: StatCardProps) { return (

{title}

{loading ? (
) : (

{value}

)}
{description && !loading && (

{description}

)} {trend && !loading && (
{trend.isPositive ? '↑' : '↓'} {Math.abs(trend.value)}%{' '} {trend.label}
)}
); }