'use client' import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend, } from 'recharts' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' interface RoundComparison { roundId: string roundName: string projectCount: number evaluationCount: number completionRate: number averageScore: number | null scoreDistribution: { score: number; count: number }[] } interface CrossRoundComparisonProps { data: RoundComparison[] } const ROUND_COLORS = ['#053d57', '#de0f1e', '#557f8c', '#f38a52', '#6ad82f'] export function CrossRoundComparisonChart({ data }: CrossRoundComparisonProps) { // Prepare comparison data const comparisonData = data.map((round, i) => ({ name: round.roundName.length > 20 ? round.roundName.slice(0, 20) + '...' : round.roundName, projects: round.projectCount, evaluations: round.evaluationCount, completionRate: round.completionRate, avgScore: round.averageScore ? parseFloat(round.averageScore.toFixed(2)) : 0, color: ROUND_COLORS[i % ROUND_COLORS.length], })) return (