// The Cartes report is intentionally a "month X vs X-1 vs X-12" snapshot, so // only a reference-month picker is surfaced here — a generic date-range // selector has no meaning on this sub-report (see issue #101). import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import { ArrowLeft } from "lucide-react"; import CompareReferenceMonthPicker from "../components/reports/CompareReferenceMonthPicker"; import CartesPeriodModeToggle from "../components/reports/cards/CartesPeriodModeToggle"; import KpiCard from "../components/reports/cards/KpiCard"; import IncomeExpenseOverlayChart from "../components/reports/cards/IncomeExpenseOverlayChart"; import TopMoversList from "../components/reports/cards/TopMoversList"; import BudgetAdherenceCard from "../components/reports/cards/BudgetAdherenceCard"; import SeasonalityCard from "../components/reports/cards/SeasonalityCard"; import { useCartes } from "../hooks/useCartes"; export default function ReportsCartesPage() { const { t } = useTranslation(); const { year, month, mode, snapshot, isLoading, error, setReferencePeriod, setMode } = useCartes(); const preserveSearch = typeof window !== "undefined" ? window.location.search : ""; // The savings-rate tooltip copy depends on the active period mode so users // always see the formula that matches the number currently on screen. The // i18n key is a nested object (month / ytd) — suffixing keeps the two // variants side by side in the locale files. const savingsRateTooltip = t( mode === "ytd" ? "reports.cartes.savingsRateTooltip.ytd" : "reports.cartes.savingsRateTooltip.month", ); return (

{t("reports.hub.cartes")}

{error && (
{error}
)} {!snapshot ? (
{t("reports.empty.noData")}
) : (
)}
); }