"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 ChartCard8Props { 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), desktop: 186, mobile: 80 }, { month: monthLabel(1), desktop: 305, mobile: 200 }, { month: monthLabel(2), desktop: 237, mobile: 120 }, { month: monthLabel(3), desktop: 273, mobile: 190 }, { month: monthLabel(4), desktop: 209, mobile: 130 }, { month: monthLabel(5), desktop: 214, mobile: 140 }, ]; const chartConfig = { desktop: { label: "دسکتاپ", color: "var(--chart-1)", }, mobile: { label: "موبایل", color: "var(--chart-2)", }, } satisfies ChartConfig; const ChartCard8 = ({ title = "ترافیک به تفکیک پلتفرم", description = "بازدیدکنندگان دسکتاپ در برابر موبایل", className, }: ChartCard8Props) => { return ( {title} {description} compactNumberFormatter.format(Number(value)) } /> numberFormatter.format(Number(value)) } /> } cursor={{ fillOpacity: 0.05 }} /> } /> ); }; export { ChartCard8 };