"use client"; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts"; import { MONTH_NAMES } from "@/lib/data"; type Props = { income: (number | null)[]; fixed: (number | null)[]; running: (number | null)[]; }; export function MachineLineChart({ income, fixed, running }: Props) { const data = MONTH_NAMES.map((m, i) => ({ month: m, income: income[i] ?? null, fixed: fixed[i] ?? null, running: running[i] ?? null, })); const fmt = (v: number) => new Intl.NumberFormat("en-ZA", { style: "currency", currency: "ZAR", maximumFractionDigits: 0, notation: "compact" }).format(v); return (
fmt(v)} />
); }