import React from 'react'; import { formatCurrency, formatPercent, getChangeColor } from '../utils/helpers'; import { TrendingUp, TrendingDown } from 'lucide-react'; const StatCard = ({ title, value, change, changePercent, icon: Icon, isCurrency = true, prefix = '', suffix = '' }) => { const isPositive = change >= 0; const TrendIcon = isPositive ? TrendingUp : TrendingDown; return (

{title}

{prefix} {isCurrency ? formatCurrency(value) : value} {suffix}

{Icon && (
)}
{(change !== undefined || changePercent !== undefined) && (
{formatPercent(changePercent)}
{change !== undefined && ( {change >= 0 ? '+' : ''}{formatCurrency(change)} )}
)}
); }; export default StatCard;