'use client'; import Link from 'next/link'; import type { ModelActiveRound } from '@/src/services/modelService'; interface ModelActiveRoundsProps { rounds: ModelActiveRound[]; } function statusBadgeClasses(status: string): string { switch (status) { case 'registration': return 'bg-yellow-100 text-yellow-800'; case 'active': return 'bg-green-100 text-green-800'; default: return 'bg-gray-100 text-gray-800'; } } function formatDateTime(value: string | null): string { if (!value) return '–'; try { return new Date(value).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit', timeZoneName: 'short', }); } catch { return value; } } export default function ModelActiveRounds({ rounds }: ModelActiveRoundsProps) { if (!rounds || rounds.length === 0) { return null; } return (

Active Challenge Rounds

Rounds this model is registered for that are currently in registration or active state.

{rounds.length} {rounds.length === 1 ? 'round' : 'rounds'}
{rounds.map((r) => ( ))}
Round Challenge Status Submission Deadline Round End
{r.definition_id ? ( {r.round_name} ) : ( {r.round_name} )} {r.definition_name || '–'} {r.status} {formatDateTime(r.registration_end)} {formatDateTime(r.end_time)}
); }