'use client'; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'; import { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from '@/components/ui/chart'; import type { ReactNode } from 'react'; import { Cell, Pie, PieChart } from 'recharts'; interface PieChartProps { title: string; description?: string; data: Record[]; config: ChartConfig; dataKey: string; nameKey: string; className?: string; footer?: ReactNode; } export function PieChartComponent({ title, description, data, config, dataKey, nameKey, footer }: PieChartProps) { return ( {title} {description && {description}} } /> {data.map((entry, index) => ( ))} } className="-translate-y-2 flex-wrap gap-2 [&>*]:basis-1/4 [&>*]:justify-center" /> {footer && {footer}} ); }