import { PieChart as RechartsPieChart, Pie, Cell, ResponsiveContainer, Tooltip } from 'recharts'; import { ChartData } from '../../types'; interface PieChartProps { data: ChartData[]; title?: string; colors?: string[]; } const DEFAULT_COLORS = ['#3b82f6', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6']; export const PieChart = ({ data, title, colors = DEFAULT_COLORS }: PieChartProps) => { return (
{title && (

{title}

)} `${name} ${(percent * 100).toFixed(0)}%`} outerRadius={80} fill="#8884d8" dataKey="value" > {data.map((entry, index) => ( ))}
); };