"use client"; import { CartesianGrid, Line, LineChart, 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 ChartCard6Props { title?: string; description?: string; className?: string; } const monthLabel = (monthIndex: number) => new Intl.DateTimeFormat("fa-IR", { month: "short" }).format( new Date(2025, monthIndex, 1), ); const chartData = [ { month: monthLabel(0), current: 186, previous: 165 }, { month: monthLabel(1), current: 305, previous: 280 }, { month: monthLabel(2), current: 237, previous: 251 }, { month: monthLabel(3), current: 273, previous: 240 }, { month: monthLabel(4), current: 209, previous: 195 }, { month: monthLabel(5), current: 314, previous: 285 }, ]; const currencyFormatter = new Intl.NumberFormat("fa-IR", { style: "currency", currency: "IRR", minimumFractionDigits: 0, maximumFractionDigits: 0, }); const compactCurrencyFormatter = new Intl.NumberFormat("fa-IR", { style: "currency", currency: "IRR", notation: "compact", minimumFractionDigits: 0, maximumFractionDigits: 0, }); const chartConfig = { current: { label: "امسال", color: "var(--chart-1)", }, previous: { label: "سال قبل", color: "var(--chart-4)", }, } satisfies ChartConfig; const ChartCard6 = ({ title = "مقایسه درآمد", description = "سال جاری در برابر سال قبل", className, }: ChartCard6Props) => { return ( {title} {description} compactCurrencyFormatter.format(Number(value)) } /> currencyFormatter.format(Number(value)) } /> } cursor={{ stroke: "var(--border)", strokeDasharray: "4 4" }} /> } /> ); }; export { ChartCard6 };