"use client" import { formatCurrency } from "@/lib/utils" const CATEGORY_COLORS: Record = { repairs: "bg-amber-500", utilities: "bg-blue-500", insurance: "bg-violet-500", mortgage: "bg-indigo-500", taxes: "bg-red-500", management: "bg-emerald-500", supplies: "bg-cyan-500", other: "bg-white/20", } interface Props { data: { category: string; amount: number }[] } export function ExpenseBreakdownChart({ data }: Props) { const total = data.reduce((s, d) => s + d.amount, 0) if (!data.length || total === 0) return null return (

Expense Breakdown (6 months)

{/* Bar */}
{data.map((d) => (
))}
{/* Legend */}
{data.map((d) => (
{d.category}
{Math.round((d.amount / total) * 100)}% {formatCurrency(d.amount)}
))}
Total {formatCurrency(total)}
) }