'use client' import { useParams } from 'next/navigation' import Link from 'next/link' import type { Route } from 'next' import { trpc } from '@/lib/trpc/client' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Skeleton } from '@/components/ui/skeleton' import { ArrowLeft, CheckCircle2, Clock, Circle } from 'lucide-react' import { toast } from 'sonner' export default function JuryRoundDetailPage() { const params = useParams() const roundId = params.roundId as string const { data: assignments, isLoading } = trpc.roundAssignment.getMyAssignments.useQuery( { roundId }, { enabled: !!roundId } ) const { data: round } = trpc.round.getById.useQuery( { id: roundId }, { enabled: !!roundId } ) if (isLoading) { return (
) } return (

{round?.name || 'Round Details'}

Your assigned projects for this round

Assigned Projects {!assignments || assignments.length === 0 ? (

No assignments yet

You will see your assigned projects here once they are assigned

) : (
{assignments.map((assignment) => { const isCompleted = assignment.evaluation?.status === 'SUBMITTED' const isDraft = assignment.evaluation?.status === 'DRAFT' return (

{assignment.project.title}

{assignment.project.competitionCategory && ( {assignment.project.competitionCategory} )}
{isCompleted ? ( Completed ) : isDraft ? ( Draft ) : ( Pending )}
) })}
)}
) }