+ );
+}
diff --git a/frontend/src/components/dashboard/SpendingByCategoryCard.tsx b/frontend/src/components/dashboard/SpendingByCategoryCard.tsx
index ceae726..d3370e9 100644
--- a/frontend/src/components/dashboard/SpendingByCategoryCard.tsx
+++ b/frontend/src/components/dashboard/SpendingByCategoryCard.tsx
@@ -1,12 +1,13 @@
import { useState } from "react";
-import { ChevronDown, ChevronRight } from "lucide-react";
+import { ChevronRight } from "lucide-react";
import { Cell, Pie, PieChart, ResponsiveContainer, Tooltip } from "recharts";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card";
+import { CategoryBreakdownModal } from "@/components/categories/CategoryBreakdownModal";
import { getCategoryIcon } from "@/lib/icons";
import { formatCurrency } from "@/lib/format";
-import { useTranslation, type TranslationKey } from "@/lib/i18n";
+import { useTranslation } from "@/lib/i18n";
import { translateCategoryName } from "@/lib/categoryLabels";
-import type { CategoryBreakdownChildItem, CategoryBreakdownItem } from "@/types";
+import type { CategoryBreakdownItem } from "@/types";
interface SpendingByCategoryCardProps {
items: CategoryBreakdownItem[];
@@ -25,31 +26,18 @@ function DonutTooltip({ active, payload }: { active?: boolean; payload?: Array<{
);
}
-// A child's category_id equals its parent's own — the enclosing
-// CategoryBreakdownItem's — when that slice of spend was filed directly on
-// the parent with no more specific subcategory chosen (see
-// services/category_rollup.py's CategoryRollupChildItem).
-function childLabel(child: CategoryBreakdownChildItem, parentId: number | null, t: (key: TranslationKey) => string) {
- return child.category_id === parentId ? t("reports.directSpendLabel") : translateCategoryName(child.name);
-}
-
export function SpendingByCategoryCard({ items }: SpendingByCategoryCardProps) {
const { t } = useTranslation();
- const [expanded, setExpanded] = useState