- Delete DynamicReport* components and pivot types (PivotConfig, PivotResult, PivotFieldId, etc.) - Remove getDynamicReportData/getDynamicFilterValues from reportService - Strip pivotConfig/pivotResult from useReports hook and ReportsPage - Drop "dynamic" from ReportTab union - Remove reports.pivot.* and reports.dynamic i18n keys in FR and EN - Add skeletons for /reports/highlights, /trends, /compare, /category pages - Register the 4 new sub-routes in App.tsx - Add reports.hub, reports.viewMode, reports.empty, common.underConstruction keys - New shared ContextMenu component with click-outside + Escape handling - Refactor ChartContextMenu to compose generic ContextMenu - New ViewModeToggle with localStorage persistence via storageKey - New Sparkline (Recharts LineChart) for compact trends - Unit tests for readViewMode helper Fixes #69 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
44 lines
882 B
TypeScript
44 lines
882 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { EyeOff, List } from "lucide-react";
|
|
import ContextMenu from "./ContextMenu";
|
|
|
|
export interface ChartContextMenuProps {
|
|
x: number;
|
|
y: number;
|
|
categoryName: string;
|
|
onHide: () => void;
|
|
onViewDetails: () => void;
|
|
onClose: () => void;
|
|
}
|
|
|
|
export default function ChartContextMenu({
|
|
x,
|
|
y,
|
|
categoryName,
|
|
onHide,
|
|
onViewDetails,
|
|
onClose,
|
|
}: ChartContextMenuProps) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<ContextMenu
|
|
x={x}
|
|
y={y}
|
|
header={categoryName}
|
|
onClose={onClose}
|
|
items={[
|
|
{
|
|
icon: <List size={14} />,
|
|
label: t("charts.viewTransactions"),
|
|
onClick: onViewDetails,
|
|
},
|
|
{
|
|
icon: <EyeOff size={14} />,
|
|
label: t("charts.hideCategory"),
|
|
onClick: onHide,
|
|
},
|
|
]}
|
|
/>
|
|
);
|
|
}
|