import { motion, useReducedMotion } from 'framer-motion'; import { ArrowUpRight, ArrowDownRight } from 'lucide-react'; import Card from '@/components/ui/Card'; interface MetricCardProps { title: string; value: number | string; change?: number; icon: React.ElementType; suffix?: string; prefix?: string; delay?: number; } export default function MetricCard({ title, value, change, icon: Icon, suffix = '', prefix = '', delay = 0, }: MetricCardProps) { const shouldReduceMotion = useReducedMotion(); const isPositive = change && change > 0; const isNegative = change && change < 0; return (
{change !== undefined && (
{isPositive ? : isNegative ? : null} {Math.abs(change)}%
)}
{prefix}{typeof value === 'number' ? value.toLocaleString() : value}{suffix}
{title}
); }