"use client"; import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent, } from "@/components/ui/chart"; import { cn } from "@/lib/utils"; interface ChartCard1Props { 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), value: 186 }, { month: monthLabel(1), value: 305 }, { month: monthLabel(2), value: 237 }, { month: monthLabel(3), value: 273 }, { month: monthLabel(4), value: 209 }, { month: monthLabel(5), value: 214 }, { month: monthLabel(6), value: 286 }, { month: monthLabel(7), value: 320 }, { month: monthLabel(8), value: 298 }, { month: monthLabel(9), value: 342 }, { month: monthLabel(10), value: 375 }, { month: monthLabel(11), value: 410 }, ]; 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 = { value: { label: "درآمد", color: "var(--chart-1)", }, } satisfies ChartConfig; const ChartCard1 = ({ title = "روند درآمد", description = "درآمد ماهانه در سال جاری", className, }: ChartCard1Props) => { return ( {title} {description} compactCurrencyFormatter.format(Number(value)) } /> currencyFormatter.format(Number(value)) } /> } cursor={{ stroke: "var(--border)", strokeDasharray: "4 4" }} /> ); }; export { ChartCard1 };