"use client"; import { PieChart as RechartsPieChart, Pie, Cell, Tooltip, Legend, ResponsiveContainer } from 'recharts'; interface PieChartProps { data: Array<{ [key: string]: any }>; title?: string; height?: number; donut?: boolean; nameKey?: string; valueKey?: string; } // Color palette const COLORS = ['#6366f1', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6', '#06b6d4', '#ec4899', '#84cc16']; export default function PieChart({ data, title, height = 300, donut = false }: PieChartProps) { // Calculate total for percentage const total = data.reduce((sum, item) => sum + item.value, 0); return (