import { Card } from '@astryxdesign/core/Card'; // ==============================|| STAT / KPI CARD ||============================== // export default function StatCard({ title, value, icon: Icon, color = 'primary', trend, caption, size = 'md' }) { const trendUp = typeof trend === 'number' ? trend >= 0 : null; const isCompact = size === 'sm'; // Map theme colors to CSS values const colorMap = { primary: { main: '#C01227', light: 'rgba(192, 18, 39, 0.04)', border: 'rgba(192, 18, 39, 0.1)' }, secondary: { main: '#475569', light: 'rgba(71, 85, 105, 0.04)', border: 'rgba(71, 85, 105, 0.1)' }, success: { main: '#10b981', light: 'rgba(16, 185, 129, 0.04)', border: 'rgba(16, 185, 129, 0.1)' }, warning: { main: '#f59e0b', light: 'rgba(245, 158, 11, 0.04)', border: 'rgba(245, 158, 11, 0.1)' }, error: { main: '#ef4444', light: 'rgba(239, 68, 68, 0.04)', border: 'rgba(239, 68, 68, 0.1)' }, info: { main: '#3b82f6', light: 'rgba(59, 130, 246, 0.04)', border: 'rgba(59, 130, 246, 0.1)' } }; const themeColor = colorMap[color] || colorMap.primary; return ( {Icon && (
)}
{title} {Icon && (
)}
{value}
{(trendUp !== null || caption) && (
{trendUp !== null && (
{trendUp ? '↑' : '↓'} {Math.abs(trend)}%
)} {caption && ( {caption} )}
)}
); }