import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { cn } from "@/lib/utils"; const formatPrice = (value: number) => `${value.toLocaleString("fa-IR")} ریال`; const formatNumber = (value: number) => value.toLocaleString("fa-IR"); interface BreakdownItem { label: string; value: string; percentage?: number; } interface StatsCard6Props { title?: string; totalValue?: string; breakdown?: BreakdownItem[]; className?: string; } const defaultBreakdown: BreakdownItem[] = [ { label: "وب", value: formatPrice(32450000), percentage: 65 }, { label: "موبایل", value: formatPrice(12300000), percentage: 25 }, { label: "تبلت", value: formatPrice(5250000), percentage: 10 }, ]; const StatsCard6 = ({ title = "درآمد بر اساس کانال", totalValue = formatPrice(50000000), breakdown = defaultBreakdown, className, }: StatsCard6Props) => { return ( {title}
{totalValue}
{breakdown.map((item, index) => (
{item.label}
{item.value} {item.percentage !== undefined && ( {formatNumber(item.percentage)}٪ )}
))}
); }; export { StatsCard6 };