import { useTranslation } from "react-i18next"; import { AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, CartesianGrid, } from "recharts"; import type { MonthlyTrendItem } from "../../shared/types"; const cadFormatter = (value: number) => new Intl.NumberFormat("en-CA", { style: "currency", currency: "CAD", maximumFractionDigits: 0 }).format(value); function formatMonth(month: string): string { const [year, m] = month.split("-"); const date = new Date(Number(year), Number(m) - 1); return date.toLocaleDateString("default", { month: "short", year: "2-digit" }); } interface MonthlyTrendsChartProps { data: MonthlyTrendItem[]; } export default function MonthlyTrendsChart({ data }: MonthlyTrendsChartProps) { const { t } = useTranslation(); if (data.length === 0) { return (
{t("dashboard.noData")}