"use client" import { Bar, BarChart, CartesianGrid, XAxis, YAxis } from "recharts" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, type ChartConfig, } from "@/components/ui/chart" import { formatCurrency, formatShortCurrency } from "@/lib/formatters" export const description = "Perbandingan total penjualan dan belanja per bulan." const chartConfig = { sales: { label: "Penjualan", color: "var(--chart-1)", }, purchase: { label: "Belanja", color: "var(--chart-2)", }, } satisfies ChartConfig export function RevenueVsPurchasesChart({ data }: { data: any[] }) { return ( Penjualan vs Belanja Perbandingan total penjualan dan belanja per bulan value.slice(0, 3)} /> [ formatCurrency(Number(value)), ` - ${chartConfig[name as keyof typeof chartConfig]?.label ?? name}`, ]} /> } /> } /> ) }