import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Progress } from "@/components/ui/progress"; import { cn } from "@/lib/utils"; const formatPrice = (value: number) => `${value.toLocaleString("fa-IR")} ریال`; const formatNumber = (value: number) => value.toLocaleString("fa-IR"); const formatAmount = (amount: number, unit: string) => unit === "ریال" ? formatPrice(amount) : `${unit}${formatNumber(amount)}`; interface StatsCard3Props { title?: string; value?: number; target?: number; unit?: string; className?: string; } const StatsCard3 = ({ title = "هدف درآمد ماهانه", value = 7500000, target = 10000000, unit = "ریال", className, }: StatsCard3Props) => { const percentage = Math.min(Math.round((value / target) * 100), 100); return ( {title}
{formatAmount(value, unit)}
{formatNumber(percentage)}٪ محقق‌شده هدف: {formatAmount(target, unit)}
); }; export { StatsCard3 };