"use client"; import { Bar, BarChart, CartesianGrid, XAxis, YAxis } from "recharts"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "@/components/ui/chart"; import { cn } from "@/lib/utils"; interface ChartCard10Props { title?: string; description?: string; className?: string; } const monthLabel = (monthIndex: number) => new Intl.DateTimeFormat("fa-IR", { month: "short" }).format( new Date(2025, monthIndex, 1), ); const numberFormatter = new Intl.NumberFormat("fa-IR", { maximumFractionDigits: 0, }); const compactNumberFormatter = new Intl.NumberFormat("fa-IR", { notation: "compact", maximumFractionDigits: 1, }); const chartData = [ { month: monthLabel(0), organic: 186, paid: 80, referral: 45 }, { month: monthLabel(1), organic: 305, paid: 200, referral: 65 }, { month: monthLabel(2), organic: 237, paid: 120, referral: 55 }, { month: monthLabel(3), organic: 273, paid: 190, referral: 70 }, { month: monthLabel(4), organic: 209, paid: 130, referral: 50 }, { month: monthLabel(5), organic: 214, paid: 140, referral: 60 }, ]; const chartConfig = { organic: { label: "ارگانیک", color: "var(--chart-1)", }, paid: { label: "پولی", color: "var(--chart-2)", }, referral: { label: "ارجاع", color: "var(--chart-3)", }, } satisfies ChartConfig; const ChartCard10 = ({ title = "کانال‌های جذب", description = "تفکیک منابع ترافیک به تفکیک ماه", className, }: ChartCard10Props) => { return ( {title} {description} compactNumberFormatter.format(Number(value)) } /> numberFormatter.format(Number(value)) } /> } cursor={{ fillOpacity: 0.05 }} /> } /> ); }; export { ChartCard10 };