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