import { useState, useEffect } from 'react'; interface JurorProgress { completed: number; total: number; } /** * Displays juror voting progress (X/11 teams completed per juror). * Fetches from GET /api/progress. No individual scores shown. */ export default function ProgressMatrix() { const [progress, setProgress] = useState>({}); const [loading, setLoading] = useState(true); useEffect(() => { fetchProgress(); const interval = setInterval(fetchProgress, 5000); return () => clearInterval(interval); }, []); function fetchProgress() { fetch('/api/progress') .then((res) => res.json()) .then((data) => { setProgress(data); setLoading(false); }) .catch(() => setLoading(false)); } if (loading) { return
Lade Fortschritt...
; } const entries = Object.entries(progress); const allComplete = entries.length > 0 && entries.every(([, p]) => p.completed === p.total); return (

Fortschritt

{allComplete && (
✓ Alle Bewertungen abgeschlossen
)}
{entries.map(([jurorId, { completed, total }]) => { const percent = total > 0 ? (completed / total) * 100 : 0; const isComplete = completed === total; return (
{jurorId.charAt(0).toUpperCase() + jurorId.slice(1)} {completed}/{total}
); })}
); }