'use client'; import { PieChart, Pie, Cell, Tooltip, ResponsiveContainer } from 'recharts'; interface AllocationChartProps { data: { name: string; value: number; fill: string }[]; } const CHART_COLORS = [ '#3b82f6', '#8b5cf6', '#10b981', '#f59e0b', '#ef4444', '#06b6d4', ]; export default function AllocationChart({ data }: AllocationChartProps) { if (!data || data.length === 0) { return (
暂无数据
); } return (
{data.map((entry, index) => ( ))} [ value.toLocaleString(), name, ]} />
); }