import { Card, CardContent } from '@/components/ui/card'; import { cn } from '@/lib/utils'; import { TrendingUp, TrendingDown, Minus } from 'lucide-react'; interface KpiCardProps { title: string; value: string | number; subtitle?: string; trend?: 'up' | 'down' | 'neutral'; trendValue?: string; icon?: React.ReactNode; className?: string; } export function KpiCard({ title, value, subtitle, trend, trendValue, icon, className, }: KpiCardProps) { const formatValue = (val: string | number) => { if (typeof val === 'number') { return new Intl.NumberFormat('es-MX', { style: 'currency', currency: 'MXN', minimumFractionDigits: 0, maximumFractionDigits: 0, }).format(val); } return val; }; return (

{title}

{icon &&
{icon}
}

{formatValue(value)}

{(subtitle || trend) && (
{trend && ( {trend === 'up' && } {trend === 'down' && } {trend === 'neutral' && } {trendValue} )} {subtitle && ( {subtitle} )}
)}
); }