interface StatsCardProps { title: string; value: string | number; change: number; unit?: string; colorScheme?: 'blue' | 'green' | 'red' | 'purple'; } export default function StatsCard({ title, value, change, unit = '', colorScheme = 'blue' }: StatsCardProps) { const isPositive = change >= 0; const hasPercentUnit = unit === '%'; // Color mappings based on the colorScheme const gradientBg = { blue: 'bg-gradient-blue', green: 'bg-gradient-green', red: 'bg-gradient-red', purple: 'bg-gradient-purple', }[colorScheme]; const accentColor = { blue: 'text-accent-blue', green: 'text-accent-green', red: 'text-accent-red', purple: 'text-accent-purple', }[colorScheme]; return (
{/* Colorful top bar */}

{title}

{value} {hasPercentUnit && %}

{isPositive ? '+' : ''}{change}%
{/* Visual indicator for percentages */} {hasPercentUnit && (
)}
); }