import { notFound } from 'next/navigation' import Link from 'next/link' import { api } from '@/lib/trpc/server' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from '@/components/ui/card' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table' import { ArrowLeft, Pencil, Plus, Settings } from 'lucide-react' import { formatDateOnly } from '@/lib/utils' interface ProgramDetailPageProps { params: Promise<{ id: string }> } const statusColors: Record = { DRAFT: 'secondary', ACTIVE: 'default', CLOSED: 'success', ARCHIVED: 'secondary', } export default async function ProgramDetailPage({ params }: ProgramDetailPageProps) { const { id } = await params const caller = await api() let program try { program = await caller.program.get({ id }) } catch { notFound() } return (

{program.name}

{program.status}

{program.year} Edition

{program.description && ( Description

{program.description}

)}
Rounds Voting rounds for this program
{program.rounds.length === 0 ? (
No rounds created yet. Create a round to start accepting projects.
) : ( Round Status Projects Assignments Created {program.rounds.map((round) => ( {round.name} {round.status} {round._count.projects} {round._count.assignments} {formatDateOnly(round.createdAt)} ))}
)}
) }