"use client"; import { Area, AreaChart, 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 ChartCard9Props { 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, tablet: 45 }, { month: monthLabel(1), desktop: 305, mobile: 200, tablet: 65 }, { month: monthLabel(2), desktop: 237, mobile: 120, tablet: 55 }, { month: monthLabel(3), desktop: 273, mobile: 190, tablet: 70 }, { month: monthLabel(4), desktop: 209, mobile: 130, tablet: 50 }, { month: monthLabel(5), desktop: 214, mobile: 140, tablet: 60 }, { month: monthLabel(6), desktop: 256, mobile: 165, tablet: 72 }, { month: monthLabel(7), desktop: 289, mobile: 180, tablet: 68 }, ]; const chartConfig = { desktop: { label: "دسکتاپ", color: "var(--chart-1)", }, mobile: { label: "موبایل", color: "var(--chart-2)", }, tablet: { label: "تبلت", color: "var(--chart-3)", }, } satisfies ChartConfig; const ChartCard9 = ({ title = "منابع ترافیک", description = "بازدیدکنندگان به تفکیک نوع دستگاه در طول زمان", className, }: ChartCard9Props) => { return ( {title} {description} compactNumberFormatter.format(Number(value)) } /> numberFormatter.format(Number(value)) } /> } cursor={{ stroke: "var(--border)", strokeDasharray: "4 4" }} /> } /> ); }; export { ChartCard9 };