import { motion, useReducedMotion } from 'framer-motion'; import { ArrowDownRight, ArrowUpRight, LucideIcon } from 'lucide-react'; import { Box } from './Box'; import { Card } from './Card'; import { Icon } from './Icon'; import { Stack } from './Stack'; import { Text } from './Text'; interface StatCardProps { label: string; value: string | number; subValue?: string; icon?: LucideIcon; variant?: 'blue' | 'purple' | 'green' | 'orange'; className?: string; trend?: { value: number; isPositive: boolean; }; prefix?: string; suffix?: string; delay?: number; } export function StatCard({ label, value, subValue, icon, variant = 'blue', className = '', trend, prefix = '', suffix = '', delay = 0, }: StatCardProps) { const shouldReduceMotion = useReducedMotion(); const variantClasses = { blue: 'bg-gradient-to-br from-blue-900/20 to-blue-700/10 border-blue-500/30', purple: 'bg-gradient-to-br from-purple-900/20 to-purple-700/10 border-purple-500/30', green: 'bg-gradient-to-br from-green-900/20 to-green-700/10 border-green-500/30', orange: 'bg-gradient-to-br from-orange-900/20 to-orange-700/10 border-orange-500/30' }; const iconColorClasses = { blue: 'text-primary-blue', purple: 'text-purple-400', green: 'text-performance-green', orange: 'text-warning-amber' }; const iconHexColors = { blue: '#3b82f6', purple: '#a78bfa', green: '#34d399', orange: '#fb923c' }; const cardContent = ( {icon && ( )} {trend && ( {Math.abs(trend.value)}% )} {prefix}{typeof value === 'number' ? value.toLocaleString() : value}{suffix} {label} {subValue && ( {subValue} )} ); if (shouldReduceMotion) { return {cardContent}; } return ( {cardContent} ); }