2026-01-30 13:41:32 +01:00
|
|
|
import type { Metadata } from 'next'
|
|
|
|
|
import { Suspense } from 'react'
|
|
|
|
|
import Link from 'next/link'
|
|
|
|
|
import { auth } from '@/lib/auth'
|
|
|
|
|
import { prisma } from '@/lib/prisma'
|
|
|
|
|
|
|
|
|
|
export const metadata: Metadata = { title: 'Jury Dashboard' }
|
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
|
import {
|
|
|
|
|
Card,
|
|
|
|
|
CardContent,
|
|
|
|
|
CardDescription,
|
|
|
|
|
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 {
|
|
|
|
|
ClipboardList,
|
|
|
|
|
CheckCircle2,
|
|
|
|
|
Clock,
|
|
|
|
|
ArrowRight,
|
2026-02-08 14:37:32 +01:00
|
|
|
GitCompare,
|
|
|
|
|
Zap,
|
|
|
|
|
BarChart3,
|
|
|
|
|
Target,
|
2026-02-10 23:08:00 +01:00
|
|
|
Waves,
|
2026-01-30 13:41:32 +01:00
|
|
|
} from 'lucide-react'
|
|
|
|
|
import { formatDateOnly } from '@/lib/utils'
|
Implement 10 platform features: evaluation UX, admin tools, AI summaries, applicant portal
Batch 1 - Quick Wins:
- F1: Evaluation progress indicator with touch tracking in sticky status bar
- F2: Export filtering results as CSV with dynamic AI column flattening
- F3: Observer access to analytics dashboards (8 procedures changed to observerProcedure)
Batch 2 - Jury Experience:
- F4: Countdown timer component with urgency colors + email reminder service with cron endpoint
- F5: Conflict of interest declaration system (dialog, admin management, review workflow)
Batch 3 - Admin & AI Enhancements:
- F6: Bulk status update UI with selection checkboxes, floating toolbar, status history recording
- F7: AI-powered evaluation summary with anonymized data, OpenAI integration, scoring patterns
- F8: Smart assignment improvements (geo diversity penalty, round familiarity bonus, COI blocking)
Batch 4 - Form Flexibility & Applicant Portal:
- F9: Evaluation form flexibility (text, boolean, section_header types, conditional visibility)
- F10: Applicant portal (status timeline, per-round documents, mentor messaging)
Schema: 5 new models (ReminderLog, ConflictOfInterest, EvaluationSummary, ProjectStatusHistory, MentorMessage), ProjectFile extended with roundId + isLate.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 21:58:27 +01:00
|
|
|
import { CountdownTimer } from '@/components/shared/countdown-timer'
|
2026-02-10 23:08:00 +01:00
|
|
|
import { AnimatedCard } from '@/components/shared/animated-container'
|
2026-02-08 14:37:32 +01:00
|
|
|
import { cn } from '@/lib/utils'
|
|
|
|
|
|
|
|
|
|
function getGreeting(): string {
|
|
|
|
|
const hour = new Date().getHours()
|
|
|
|
|
if (hour < 12) return 'Good morning'
|
|
|
|
|
if (hour < 18) return 'Good afternoon'
|
|
|
|
|
return 'Good evening'
|
|
|
|
|
}
|
2026-01-30 13:41:32 +01:00
|
|
|
|
|
|
|
|
async function JuryDashboardContent() {
|
|
|
|
|
const session = await auth()
|
|
|
|
|
const userId = session?.user?.id
|
|
|
|
|
|
|
|
|
|
if (!userId) {
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get all assignments for this jury member
|
|
|
|
|
const assignments = await prisma.assignment.findMany({
|
2026-02-08 14:37:32 +01:00
|
|
|
where: { userId },
|
2026-01-30 13:41:32 +01:00
|
|
|
include: {
|
|
|
|
|
project: {
|
|
|
|
|
select: {
|
|
|
|
|
id: true,
|
|
|
|
|
title: true,
|
|
|
|
|
teamName: true,
|
2026-02-08 14:37:32 +01:00
|
|
|
country: true,
|
2026-01-30 13:41:32 +01:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
round: {
|
|
|
|
|
select: {
|
|
|
|
|
id: true,
|
|
|
|
|
name: true,
|
|
|
|
|
status: true,
|
|
|
|
|
votingStartAt: true,
|
|
|
|
|
votingEndAt: true,
|
|
|
|
|
program: {
|
|
|
|
|
select: {
|
|
|
|
|
name: true,
|
2026-02-08 14:37:32 +01:00
|
|
|
year: true,
|
2026-01-30 13:41:32 +01:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
evaluation: {
|
|
|
|
|
select: {
|
|
|
|
|
id: true,
|
|
|
|
|
status: true,
|
|
|
|
|
submittedAt: true,
|
2026-02-08 14:37:32 +01:00
|
|
|
criterionScoresJson: true,
|
|
|
|
|
form: {
|
|
|
|
|
select: { criteriaJson: true },
|
|
|
|
|
},
|
2026-01-30 13:41:32 +01:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
orderBy: [
|
|
|
|
|
{ round: { votingEndAt: 'asc' } },
|
|
|
|
|
{ createdAt: 'asc' },
|
|
|
|
|
],
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// Calculate stats
|
|
|
|
|
const totalAssignments = assignments.length
|
|
|
|
|
const completedAssignments = assignments.filter(
|
|
|
|
|
(a) => a.evaluation?.status === 'SUBMITTED'
|
|
|
|
|
).length
|
|
|
|
|
const inProgressAssignments = assignments.filter(
|
|
|
|
|
(a) => a.evaluation?.status === 'DRAFT'
|
|
|
|
|
).length
|
|
|
|
|
const pendingAssignments =
|
|
|
|
|
totalAssignments - completedAssignments - inProgressAssignments
|
|
|
|
|
|
|
|
|
|
const completionRate =
|
|
|
|
|
totalAssignments > 0 ? (completedAssignments / totalAssignments) * 100 : 0
|
|
|
|
|
|
|
|
|
|
// Group assignments by round
|
|
|
|
|
const assignmentsByRound = assignments.reduce(
|
|
|
|
|
(acc, assignment) => {
|
|
|
|
|
const roundId = assignment.round.id
|
|
|
|
|
if (!acc[roundId]) {
|
|
|
|
|
acc[roundId] = {
|
|
|
|
|
round: assignment.round,
|
|
|
|
|
assignments: [],
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
acc[roundId].assignments.push(assignment)
|
|
|
|
|
return acc
|
|
|
|
|
},
|
|
|
|
|
{} as Record<string, { round: (typeof assignments)[0]['round']; assignments: typeof assignments }>
|
|
|
|
|
)
|
|
|
|
|
|
Implement 10 platform features: evaluation UX, admin tools, AI summaries, applicant portal
Batch 1 - Quick Wins:
- F1: Evaluation progress indicator with touch tracking in sticky status bar
- F2: Export filtering results as CSV with dynamic AI column flattening
- F3: Observer access to analytics dashboards (8 procedures changed to observerProcedure)
Batch 2 - Jury Experience:
- F4: Countdown timer component with urgency colors + email reminder service with cron endpoint
- F5: Conflict of interest declaration system (dialog, admin management, review workflow)
Batch 3 - Admin & AI Enhancements:
- F6: Bulk status update UI with selection checkboxes, floating toolbar, status history recording
- F7: AI-powered evaluation summary with anonymized data, OpenAI integration, scoring patterns
- F8: Smart assignment improvements (geo diversity penalty, round familiarity bonus, COI blocking)
Batch 4 - Form Flexibility & Applicant Portal:
- F9: Evaluation form flexibility (text, boolean, section_header types, conditional visibility)
- F10: Applicant portal (status timeline, per-round documents, mentor messaging)
Schema: 5 new models (ReminderLog, ConflictOfInterest, EvaluationSummary, ProjectStatusHistory, MentorMessage), ProjectFile extended with roundId + isLate.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 21:58:27 +01:00
|
|
|
// Get grace periods for this user
|
|
|
|
|
const gracePeriods = await prisma.gracePeriod.findMany({
|
|
|
|
|
where: {
|
|
|
|
|
userId,
|
|
|
|
|
extendedUntil: { gte: new Date() },
|
|
|
|
|
},
|
|
|
|
|
select: {
|
|
|
|
|
roundId: true,
|
|
|
|
|
extendedUntil: true,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const graceByRound = new Map<string, Date>()
|
|
|
|
|
for (const gp of gracePeriods) {
|
|
|
|
|
const existing = graceByRound.get(gp.roundId)
|
|
|
|
|
if (!existing || gp.extendedUntil > existing) {
|
|
|
|
|
graceByRound.set(gp.roundId, gp.extendedUntil)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-08 14:37:32 +01:00
|
|
|
// Active rounds (voting window open)
|
2026-01-30 13:41:32 +01:00
|
|
|
const now = new Date()
|
|
|
|
|
const activeRounds = Object.values(assignmentsByRound).filter(
|
|
|
|
|
({ round }) =>
|
|
|
|
|
round.status === 'ACTIVE' &&
|
|
|
|
|
round.votingStartAt &&
|
|
|
|
|
round.votingEndAt &&
|
|
|
|
|
new Date(round.votingStartAt) <= now &&
|
|
|
|
|
new Date(round.votingEndAt) >= now
|
|
|
|
|
)
|
|
|
|
|
|
2026-02-08 14:37:32 +01:00
|
|
|
// Find next unevaluated assignment in an active round
|
|
|
|
|
const nextUnevaluated = assignments.find((a) => {
|
|
|
|
|
const isActive =
|
|
|
|
|
a.round.status === 'ACTIVE' &&
|
|
|
|
|
a.round.votingStartAt &&
|
|
|
|
|
a.round.votingEndAt &&
|
|
|
|
|
new Date(a.round.votingStartAt) <= now &&
|
|
|
|
|
new Date(a.round.votingEndAt) >= now
|
|
|
|
|
const isIncomplete = !a.evaluation || a.evaluation.status === 'NOT_STARTED' || a.evaluation.status === 'DRAFT'
|
|
|
|
|
return isActive && isIncomplete
|
|
|
|
|
})
|
2026-01-30 13:41:32 +01:00
|
|
|
|
2026-02-08 14:37:32 +01:00
|
|
|
// Recent assignments for the quick list (latest 5)
|
|
|
|
|
const recentAssignments = assignments.slice(0, 6)
|
2026-01-30 13:41:32 +01:00
|
|
|
|
2026-02-08 14:37:32 +01:00
|
|
|
// Get active round remaining count
|
|
|
|
|
const activeRemaining = assignments.filter((a) => {
|
|
|
|
|
const isActive =
|
|
|
|
|
a.round.status === 'ACTIVE' &&
|
|
|
|
|
a.round.votingStartAt &&
|
|
|
|
|
a.round.votingEndAt &&
|
|
|
|
|
new Date(a.round.votingStartAt) <= now &&
|
|
|
|
|
new Date(a.round.votingEndAt) >= now
|
|
|
|
|
const isIncomplete = !a.evaluation || a.evaluation.status !== 'SUBMITTED'
|
|
|
|
|
return isActive && isIncomplete
|
|
|
|
|
}).length
|
2026-01-30 13:41:32 +01:00
|
|
|
|
2026-02-08 14:37:32 +01:00
|
|
|
const stats = [
|
|
|
|
|
{
|
|
|
|
|
label: 'Total Assignments',
|
|
|
|
|
value: totalAssignments,
|
|
|
|
|
icon: ClipboardList,
|
2026-02-10 23:08:00 +01:00
|
|
|
accentColor: 'border-l-blue-500',
|
|
|
|
|
iconBg: 'bg-blue-50 dark:bg-blue-950/40',
|
2026-02-08 14:37:32 +01:00
|
|
|
iconColor: 'text-blue-600 dark:text-blue-400',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Completed',
|
|
|
|
|
value: completedAssignments,
|
|
|
|
|
icon: CheckCircle2,
|
2026-02-10 23:08:00 +01:00
|
|
|
accentColor: 'border-l-emerald-500',
|
|
|
|
|
iconBg: 'bg-emerald-50 dark:bg-emerald-950/40',
|
|
|
|
|
iconColor: 'text-emerald-600 dark:text-emerald-400',
|
2026-02-08 14:37:32 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'In Progress',
|
|
|
|
|
value: inProgressAssignments,
|
|
|
|
|
icon: Clock,
|
2026-02-10 23:08:00 +01:00
|
|
|
accentColor: 'border-l-amber-500',
|
|
|
|
|
iconBg: 'bg-amber-50 dark:bg-amber-950/40',
|
2026-02-08 14:37:32 +01:00
|
|
|
iconColor: 'text-amber-600 dark:text-amber-400',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Pending',
|
|
|
|
|
value: pendingAssignments,
|
|
|
|
|
icon: Target,
|
2026-02-10 23:08:00 +01:00
|
|
|
accentColor: 'border-l-slate-400',
|
|
|
|
|
iconBg: 'bg-slate-50 dark:bg-slate-800/50',
|
|
|
|
|
iconColor: 'text-slate-500 dark:text-slate-400',
|
2026-02-08 14:37:32 +01:00
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
2026-02-11 01:26:19 +01:00
|
|
|
// Zero-assignment state: compact welcome card
|
|
|
|
|
if (totalAssignments === 0) {
|
|
|
|
|
return (
|
|
|
|
|
<AnimatedCard index={0}>
|
|
|
|
|
<Card className="overflow-hidden">
|
|
|
|
|
<div className="h-1 w-full bg-gradient-to-r from-brand-teal/40 via-brand-blue/40 to-brand-teal/40" />
|
|
|
|
|
<CardContent className="py-8 px-6">
|
|
|
|
|
<div className="flex flex-col items-center text-center mb-6">
|
|
|
|
|
<div className="rounded-2xl bg-gradient-to-br from-brand-teal/10 to-brand-blue/10 p-4 mb-3 dark:from-brand-teal/20 dark:to-brand-blue/20">
|
|
|
|
|
<ClipboardList className="h-8 w-8 text-brand-teal/60" />
|
|
|
|
|
</div>
|
|
|
|
|
<p className="text-lg font-semibold">No assignments yet</p>
|
|
|
|
|
<p className="text-sm text-muted-foreground mt-1 max-w-sm">
|
|
|
|
|
Your project assignments will appear here once an administrator assigns them to you.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="grid gap-3 sm:grid-cols-2 max-w-md mx-auto">
|
|
|
|
|
<Link
|
|
|
|
|
href="/jury/assignments"
|
|
|
|
|
className="group flex items-center gap-3 rounded-xl border border-border/60 p-3 transition-all duration-200 hover:border-brand-blue/30 hover:bg-brand-blue/5 hover:-translate-y-0.5 hover:shadow-md dark:hover:border-brand-teal/30 dark:hover:bg-brand-teal/5"
|
|
|
|
|
>
|
|
|
|
|
<div className="rounded-lg bg-blue-50 p-2 transition-colors group-hover:bg-blue-100 dark:bg-blue-950/40">
|
|
|
|
|
<ClipboardList className="h-4 w-4 text-blue-600 dark:text-blue-400" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-left">
|
|
|
|
|
<p className="font-semibold text-sm group-hover:text-brand-blue dark:group-hover:text-brand-teal transition-colors">All Assignments</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground">View evaluations</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
<Link
|
|
|
|
|
href="/jury/compare"
|
|
|
|
|
className="group flex items-center gap-3 rounded-xl border border-border/60 p-3 transition-all duration-200 hover:border-brand-teal/30 hover:bg-brand-teal/5 hover:-translate-y-0.5 hover:shadow-md"
|
|
|
|
|
>
|
|
|
|
|
<div className="rounded-lg bg-teal-50 p-2 transition-colors group-hover:bg-teal-100 dark:bg-teal-950/40">
|
|
|
|
|
<GitCompare className="h-4 w-4 text-brand-teal" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-left">
|
|
|
|
|
<p className="font-semibold text-sm group-hover:text-brand-teal transition-colors">Compare Projects</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground">Side-by-side view</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-08 14:37:32 +01:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{/* Hero CTA - Jump to next evaluation */}
|
|
|
|
|
{nextUnevaluated && activeRemaining > 0 && (
|
2026-02-10 23:08:00 +01:00
|
|
|
<AnimatedCard index={0}>
|
|
|
|
|
<Card className="overflow-hidden border-0 shadow-lg">
|
|
|
|
|
<div className="bg-gradient-to-r from-brand-blue to-brand-teal p-[1px] rounded-lg">
|
|
|
|
|
<CardContent className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 py-5 px-6 rounded-[7px] bg-background">
|
|
|
|
|
<div className="flex items-center gap-4">
|
|
|
|
|
<div className="rounded-xl bg-gradient-to-br from-brand-blue to-brand-teal p-3 shadow-sm">
|
|
|
|
|
<Zap className="h-5 w-5 text-white" />
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<p className="font-semibold text-base">
|
|
|
|
|
{activeRemaining} evaluation{activeRemaining > 1 ? 's' : ''} remaining
|
|
|
|
|
</p>
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
Continue with "{nextUnevaluated.project.title}"
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Button asChild size="lg" className="bg-brand-blue hover:bg-brand-blue-light shadow-md">
|
|
|
|
|
<Link href={`/jury/projects/${nextUnevaluated.project.id}/evaluate`}>
|
|
|
|
|
{nextUnevaluated.evaluation?.status === 'DRAFT' ? 'Continue Evaluation' : 'Start Evaluation'}
|
|
|
|
|
<ArrowRight className="ml-2 h-4 w-4" />
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</CardContent>
|
2026-02-08 14:37:32 +01:00
|
|
|
</div>
|
2026-02-10 23:08:00 +01:00
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
2026-02-08 14:37:32 +01:00
|
|
|
)}
|
|
|
|
|
|
2026-02-11 01:26:19 +01:00
|
|
|
{/* Stats + Overall Completion in one row */}
|
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-5">
|
2026-02-10 23:08:00 +01:00
|
|
|
{stats.map((stat, i) => (
|
|
|
|
|
<AnimatedCard key={stat.label} index={i + 1}>
|
|
|
|
|
<Card className={cn(
|
|
|
|
|
'border-l-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md',
|
|
|
|
|
stat.accentColor,
|
|
|
|
|
)}>
|
|
|
|
|
<CardContent className="flex items-center gap-4 py-5 px-5">
|
|
|
|
|
<div className={cn('rounded-xl p-3', stat.iconBg)}>
|
|
|
|
|
<stat.icon className={cn('h-5 w-5', stat.iconColor)} />
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<p className="text-2xl font-bold tabular-nums tracking-tight">{stat.value}</p>
|
|
|
|
|
<p className="text-sm text-muted-foreground font-medium">{stat.label}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
2026-02-08 14:37:32 +01:00
|
|
|
))}
|
2026-02-11 01:26:19 +01:00
|
|
|
{/* Overall completion as 5th stat card */}
|
|
|
|
|
<AnimatedCard index={5}>
|
|
|
|
|
<Card className="border-l-4 border-l-brand-teal transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md">
|
|
|
|
|
<CardContent className="flex items-center gap-4 py-5 px-5">
|
|
|
|
|
<div className="rounded-xl p-3 bg-brand-blue/10 dark:bg-brand-blue/20">
|
|
|
|
|
<BarChart3 className="h-5 w-5 text-brand-blue dark:text-brand-teal" />
|
2026-02-10 23:08:00 +01:00
|
|
|
</div>
|
2026-02-11 01:26:19 +01:00
|
|
|
<div className="flex-1 min-w-0">
|
|
|
|
|
<p className="text-2xl font-bold tabular-nums tracking-tight text-brand-blue dark:text-brand-teal">
|
2026-02-10 23:08:00 +01:00
|
|
|
{completionRate.toFixed(0)}%
|
2026-02-11 01:26:19 +01:00
|
|
|
</p>
|
|
|
|
|
<div className="relative h-1.5 w-full overflow-hidden rounded-full bg-muted/60 mt-1">
|
|
|
|
|
<div
|
|
|
|
|
className="h-full rounded-full bg-gradient-to-r from-brand-teal to-brand-blue transition-all duration-500 ease-out"
|
|
|
|
|
style={{ width: `${completionRate}%` }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-02-10 23:08:00 +01:00
|
|
|
</div>
|
2026-02-11 01:26:19 +01:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
|
|
|
|
</div>
|
2026-01-30 13:41:32 +01:00
|
|
|
|
2026-02-10 23:08:00 +01:00
|
|
|
{/* Main content -- two column layout */}
|
2026-02-11 01:26:19 +01:00
|
|
|
<div className="grid gap-4 lg:grid-cols-12">
|
2026-02-08 14:37:32 +01:00
|
|
|
{/* Left column */}
|
2026-02-11 01:26:19 +01:00
|
|
|
<div className="lg:col-span-7 space-y-4">
|
2026-02-08 14:37:32 +01:00
|
|
|
{/* Recent Assignments */}
|
2026-02-10 23:08:00 +01:00
|
|
|
<AnimatedCard index={6}>
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="pb-3">
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div className="flex items-center gap-2.5">
|
|
|
|
|
<div className="rounded-lg bg-brand-blue/10 p-1.5 dark:bg-brand-blue/20">
|
|
|
|
|
<ClipboardList className="h-4 w-4 text-brand-blue dark:text-brand-teal" />
|
|
|
|
|
</div>
|
|
|
|
|
<CardTitle className="text-lg">My Assignments</CardTitle>
|
|
|
|
|
</div>
|
|
|
|
|
<Button variant="ghost" size="sm" asChild className="text-brand-teal hover:text-brand-blue">
|
|
|
|
|
<Link href="/jury/assignments">
|
|
|
|
|
View all
|
|
|
|
|
<ArrowRight className="ml-1 h-3 w-3" />
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent>
|
|
|
|
|
{recentAssignments.length > 0 ? (
|
|
|
|
|
<div className="space-y-1">
|
|
|
|
|
{recentAssignments.map((assignment, idx) => {
|
|
|
|
|
const evaluation = assignment.evaluation
|
|
|
|
|
const isCompleted = evaluation?.status === 'SUBMITTED'
|
|
|
|
|
const isDraft = evaluation?.status === 'DRAFT'
|
|
|
|
|
const isVotingOpen =
|
|
|
|
|
assignment.round.status === 'ACTIVE' &&
|
|
|
|
|
assignment.round.votingStartAt &&
|
|
|
|
|
assignment.round.votingEndAt &&
|
|
|
|
|
new Date(assignment.round.votingStartAt) <= now &&
|
|
|
|
|
new Date(assignment.round.votingEndAt) >= now
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
key={assignment.id}
|
|
|
|
|
className={cn(
|
|
|
|
|
'flex items-center justify-between gap-3 py-3 px-3 -mx-3 rounded-lg transition-colors duration-150',
|
|
|
|
|
'hover:bg-muted/50',
|
|
|
|
|
idx !== recentAssignments.length - 1 && 'border-b border-border/50',
|
|
|
|
|
)}
|
2026-02-08 14:37:32 +01:00
|
|
|
>
|
2026-02-10 23:08:00 +01:00
|
|
|
<Link
|
|
|
|
|
href={`/jury/projects/${assignment.project.id}`}
|
|
|
|
|
className="flex-1 min-w-0 group"
|
|
|
|
|
>
|
|
|
|
|
<p className="text-sm font-medium truncate group-hover:text-brand-blue dark:group-hover:text-brand-teal transition-colors">
|
|
|
|
|
{assignment.project.title}
|
|
|
|
|
</p>
|
|
|
|
|
<div className="flex items-center gap-2 mt-1">
|
|
|
|
|
<span className="text-xs text-muted-foreground truncate">
|
|
|
|
|
{assignment.project.teamName}
|
|
|
|
|
</span>
|
|
|
|
|
<Badge variant="secondary" className="text-[10px] px-1.5 py-0 bg-brand-blue/5 text-brand-blue/80 dark:bg-brand-teal/10 dark:text-brand-teal/80 border-0">
|
|
|
|
|
{assignment.round.name}
|
|
|
|
|
</Badge>
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
<div className="flex items-center gap-2 shrink-0">
|
|
|
|
|
{isCompleted ? (
|
|
|
|
|
<Badge variant="success" className="text-xs">
|
|
|
|
|
<CheckCircle2 className="mr-1 h-3 w-3" />
|
|
|
|
|
Done
|
|
|
|
|
</Badge>
|
|
|
|
|
) : isDraft ? (
|
|
|
|
|
<Badge variant="warning" className="text-xs">
|
|
|
|
|
<Clock className="mr-1 h-3 w-3" />
|
|
|
|
|
Draft
|
|
|
|
|
</Badge>
|
|
|
|
|
) : (
|
|
|
|
|
<Badge variant="secondary" className="text-xs">Pending</Badge>
|
|
|
|
|
)}
|
|
|
|
|
{isCompleted ? (
|
|
|
|
|
<Button variant="ghost" size="sm" asChild className="h-7 px-2">
|
|
|
|
|
<Link href={`/jury/projects/${assignment.project.id}/evaluation`}>
|
|
|
|
|
View
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
) : isVotingOpen ? (
|
|
|
|
|
<Button size="sm" asChild className="h-7 px-3 bg-brand-blue hover:bg-brand-blue-light shadow-sm">
|
|
|
|
|
<Link href={`/jury/projects/${assignment.project.id}/evaluate`}>
|
|
|
|
|
{isDraft ? 'Continue' : 'Evaluate'}
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
) : (
|
|
|
|
|
<Button variant="ghost" size="sm" asChild className="h-7 px-2">
|
|
|
|
|
<Link href={`/jury/projects/${assignment.project.id}`}>
|
|
|
|
|
View
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
2026-02-08 14:37:32 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-10 23:08:00 +01:00
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
2026-02-11 01:26:19 +01:00
|
|
|
<div className="flex flex-col items-center justify-center py-6 text-center">
|
|
|
|
|
<div className="rounded-2xl bg-brand-teal/10 p-3 mb-2">
|
|
|
|
|
<ClipboardList className="h-6 w-6 text-brand-teal/60" />
|
2026-02-10 23:08:00 +01:00
|
|
|
</div>
|
2026-02-11 01:26:19 +01:00
|
|
|
<p className="font-medium text-sm text-muted-foreground">
|
2026-02-10 23:08:00 +01:00
|
|
|
No assignments yet
|
|
|
|
|
</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground/70 mt-1 max-w-[240px]">
|
|
|
|
|
Assignments will appear here once an administrator assigns projects to you.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
2026-01-30 13:41:32 +01:00
|
|
|
|
2026-02-08 14:37:32 +01:00
|
|
|
{/* Quick Actions */}
|
2026-02-10 23:08:00 +01:00
|
|
|
<AnimatedCard index={7}>
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="pb-3">
|
|
|
|
|
<div className="flex items-center gap-2.5">
|
|
|
|
|
<div className="rounded-lg bg-brand-teal/10 p-1.5 dark:bg-brand-teal/20">
|
|
|
|
|
<Zap className="h-4 w-4 text-brand-teal" />
|
|
|
|
|
</div>
|
|
|
|
|
<CardTitle className="text-lg">Quick Actions</CardTitle>
|
|
|
|
|
</div>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent>
|
|
|
|
|
<div className="grid gap-3 sm:grid-cols-2">
|
|
|
|
|
<Link
|
|
|
|
|
href="/jury/assignments"
|
|
|
|
|
className="group flex items-center gap-4 rounded-xl border border-border/60 p-4 transition-all duration-200 hover:border-brand-blue/30 hover:bg-brand-blue/5 hover:-translate-y-0.5 hover:shadow-md dark:hover:border-brand-teal/30 dark:hover:bg-brand-teal/5"
|
|
|
|
|
>
|
|
|
|
|
<div className="rounded-xl bg-blue-50 p-3 transition-colors group-hover:bg-blue-100 dark:bg-blue-950/40 dark:group-hover:bg-blue-950/60">
|
|
|
|
|
<ClipboardList className="h-5 w-5 text-blue-600 dark:text-blue-400" />
|
|
|
|
|
</div>
|
2026-02-08 14:37:32 +01:00
|
|
|
<div className="text-left">
|
2026-02-10 23:08:00 +01:00
|
|
|
<p className="font-semibold text-sm group-hover:text-brand-blue dark:group-hover:text-brand-teal transition-colors">All Assignments</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground mt-0.5">View and manage evaluations</p>
|
2026-01-30 13:41:32 +01:00
|
|
|
</div>
|
2026-02-08 14:37:32 +01:00
|
|
|
</Link>
|
2026-02-10 23:08:00 +01:00
|
|
|
<Link
|
|
|
|
|
href="/jury/compare"
|
|
|
|
|
className="group flex items-center gap-4 rounded-xl border border-border/60 p-4 transition-all duration-200 hover:border-brand-teal/30 hover:bg-brand-teal/5 hover:-translate-y-0.5 hover:shadow-md"
|
|
|
|
|
>
|
|
|
|
|
<div className="rounded-xl bg-teal-50 p-3 transition-colors group-hover:bg-teal-100 dark:bg-teal-950/40 dark:group-hover:bg-teal-950/60">
|
|
|
|
|
<GitCompare className="h-5 w-5 text-brand-teal" />
|
|
|
|
|
</div>
|
2026-02-08 14:37:32 +01:00
|
|
|
<div className="text-left">
|
2026-02-10 23:08:00 +01:00
|
|
|
<p className="font-semibold text-sm group-hover:text-brand-teal transition-colors">Compare Projects</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground mt-0.5">Side-by-side comparison</p>
|
2026-02-08 14:37:32 +01:00
|
|
|
</div>
|
|
|
|
|
</Link>
|
2026-02-10 23:08:00 +01:00
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
2026-02-08 14:37:32 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Right column */}
|
2026-02-11 01:26:19 +01:00
|
|
|
<div className="lg:col-span-5 space-y-4">
|
2026-02-08 14:37:32 +01:00
|
|
|
{/* Active Rounds */}
|
|
|
|
|
{activeRounds.length > 0 && (
|
2026-02-10 23:08:00 +01:00
|
|
|
<AnimatedCard index={8}>
|
|
|
|
|
<Card className="overflow-hidden">
|
|
|
|
|
<div className="h-1 w-full bg-gradient-to-r from-brand-blue via-brand-teal to-brand-blue" />
|
|
|
|
|
<CardHeader className="pb-3">
|
|
|
|
|
<div className="flex items-center gap-2.5">
|
|
|
|
|
<div className="rounded-lg bg-brand-blue/10 p-1.5 dark:bg-brand-blue/20">
|
|
|
|
|
<Waves className="h-4 w-4 text-brand-blue dark:text-brand-teal" />
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<CardTitle className="text-lg">Active Voting Rounds</CardTitle>
|
|
|
|
|
<CardDescription className="mt-0.5">
|
|
|
|
|
Rounds currently open for evaluation
|
|
|
|
|
</CardDescription>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
{activeRounds.map(({ round, assignments: roundAssignments }) => {
|
|
|
|
|
const roundCompleted = roundAssignments.filter(
|
|
|
|
|
(a) => a.evaluation?.status === 'SUBMITTED'
|
|
|
|
|
).length
|
|
|
|
|
const roundTotal = roundAssignments.length
|
|
|
|
|
const roundProgress =
|
|
|
|
|
roundTotal > 0 ? (roundCompleted / roundTotal) * 100 : 0
|
|
|
|
|
const isAlmostDone = roundProgress >= 80
|
|
|
|
|
const deadline = graceByRound.get(round.id) ?? (round.votingEndAt ? new Date(round.votingEndAt) : null)
|
|
|
|
|
const isUrgent = deadline && (deadline.getTime() - now.getTime()) < 24 * 60 * 60 * 1000
|
2026-02-08 14:37:32 +01:00
|
|
|
|
2026-02-10 23:08:00 +01:00
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
key={round.id}
|
|
|
|
|
className={cn(
|
|
|
|
|
'rounded-xl border p-4 space-y-3 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md',
|
|
|
|
|
isUrgent
|
|
|
|
|
? 'border-red-200 bg-red-50/50 dark:border-red-900 dark:bg-red-950/20'
|
|
|
|
|
: 'border-border/60 bg-muted/20 dark:bg-muted/10'
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<div className="flex items-start justify-between">
|
|
|
|
|
<div>
|
|
|
|
|
<h3 className="font-semibold text-brand-blue dark:text-brand-teal">{round.name}</h3>
|
|
|
|
|
<p className="text-xs text-muted-foreground mt-0.5">
|
|
|
|
|
{round.program.name} · {round.program.year}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
{isAlmostDone ? (
|
|
|
|
|
<Badge variant="success">Almost done</Badge>
|
|
|
|
|
) : (
|
|
|
|
|
<Badge variant="info">Active</Badge>
|
|
|
|
|
)}
|
2026-02-08 14:37:32 +01:00
|
|
|
</div>
|
2026-01-30 13:41:32 +01:00
|
|
|
|
2026-02-10 23:08:00 +01:00
|
|
|
<div className="space-y-1.5">
|
|
|
|
|
<div className="flex justify-between text-sm">
|
|
|
|
|
<span className="text-muted-foreground">Progress</span>
|
|
|
|
|
<span className="font-semibold tabular-nums">
|
|
|
|
|
{roundCompleted}/{roundTotal}
|
2026-02-08 14:37:32 +01:00
|
|
|
</span>
|
2026-02-10 23:08:00 +01:00
|
|
|
</div>
|
|
|
|
|
<div className="relative h-2.5 w-full overflow-hidden rounded-full bg-muted/60">
|
|
|
|
|
<div
|
|
|
|
|
className="h-full rounded-full bg-gradient-to-r from-brand-teal to-brand-blue transition-all duration-500 ease-out"
|
|
|
|
|
style={{ width: `${roundProgress}%` }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-02-08 14:37:32 +01:00
|
|
|
</div>
|
2026-02-10 23:08:00 +01:00
|
|
|
|
|
|
|
|
{deadline && (
|
|
|
|
|
<div className="flex items-center gap-2 flex-wrap">
|
|
|
|
|
<CountdownTimer
|
|
|
|
|
deadline={deadline}
|
|
|
|
|
label="Deadline:"
|
|
|
|
|
/>
|
|
|
|
|
{round.votingEndAt && (
|
|
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
({formatDateOnly(round.votingEndAt)})
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<Button asChild size="sm" className="w-full bg-brand-blue hover:bg-brand-blue-light shadow-sm">
|
|
|
|
|
<Link href={`/jury/assignments?round=${round.id}`}>
|
|
|
|
|
View Assignments
|
|
|
|
|
<ArrowRight className="ml-2 h-4 w-4" />
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
2026-02-08 14:37:32 +01:00
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* No active rounds */}
|
2026-02-11 01:26:19 +01:00
|
|
|
{activeRounds.length === 0 && (
|
2026-02-10 23:08:00 +01:00
|
|
|
<AnimatedCard index={8}>
|
|
|
|
|
<Card>
|
2026-02-11 01:26:19 +01:00
|
|
|
<CardContent className="flex flex-col items-center justify-center py-6 text-center">
|
|
|
|
|
<div className="rounded-2xl bg-brand-teal/10 p-3 mb-2 dark:bg-brand-teal/20">
|
|
|
|
|
<Clock className="h-6 w-6 text-brand-teal/70" />
|
2026-02-10 23:08:00 +01:00
|
|
|
</div>
|
|
|
|
|
<p className="font-semibold text-sm">No active voting rounds</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground mt-1 max-w-[220px]">
|
|
|
|
|
Check back later when a voting window opens
|
|
|
|
|
</p>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
2026-02-08 14:37:32 +01:00
|
|
|
)}
|
2026-01-30 13:41:32 +01:00
|
|
|
|
2026-02-08 14:37:32 +01:00
|
|
|
{/* Completion Summary by Round */}
|
|
|
|
|
{Object.keys(assignmentsByRound).length > 0 && (
|
2026-02-10 23:08:00 +01:00
|
|
|
<AnimatedCard index={9}>
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="pb-3">
|
|
|
|
|
<div className="flex items-center gap-2.5">
|
|
|
|
|
<div className="rounded-lg bg-brand-teal/10 p-1.5 dark:bg-brand-teal/20">
|
|
|
|
|
<BarChart3 className="h-4 w-4 text-brand-teal" />
|
2026-02-08 14:37:32 +01:00
|
|
|
</div>
|
2026-02-10 23:08:00 +01:00
|
|
|
<CardTitle className="text-lg">Round Summary</CardTitle>
|
|
|
|
|
</div>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
{Object.values(assignmentsByRound).map(({ round, assignments: roundAssignments }) => {
|
|
|
|
|
const done = roundAssignments.filter((a) => a.evaluation?.status === 'SUBMITTED').length
|
|
|
|
|
const total = roundAssignments.length
|
|
|
|
|
const pct = total > 0 ? Math.round((done / total) * 100) : 0
|
|
|
|
|
return (
|
|
|
|
|
<div key={round.id} className="space-y-2">
|
|
|
|
|
<div className="flex items-center justify-between text-sm">
|
|
|
|
|
<span className="font-medium truncate">{round.name}</span>
|
|
|
|
|
<div className="flex items-baseline gap-1 shrink-0 ml-2">
|
|
|
|
|
<span className="font-bold tabular-nums text-brand-blue dark:text-brand-teal">{pct}%</span>
|
|
|
|
|
<span className="text-xs text-muted-foreground">({done}/{total})</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="relative h-2 w-full overflow-hidden rounded-full bg-muted/60">
|
|
|
|
|
<div
|
|
|
|
|
className="h-full rounded-full bg-gradient-to-r from-brand-teal to-brand-blue transition-all duration-500 ease-out"
|
|
|
|
|
style={{ width: `${pct}%` }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</AnimatedCard>
|
2026-02-08 14:37:32 +01:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-30 13:41:32 +01:00
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function DashboardSkeleton() {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2026-02-10 23:08:00 +01:00
|
|
|
{/* Stats skeleton */}
|
2026-01-30 13:41:32 +01:00
|
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
|
|
|
{[...Array(4)].map((_, i) => (
|
2026-02-10 23:08:00 +01:00
|
|
|
<Card key={i} className="border-l-4 border-l-muted">
|
|
|
|
|
<CardContent className="flex items-center gap-4 py-5 px-5">
|
|
|
|
|
<Skeleton className="h-11 w-11 rounded-xl" />
|
2026-02-08 14:37:32 +01:00
|
|
|
<div className="space-y-2">
|
2026-02-10 23:08:00 +01:00
|
|
|
<Skeleton className="h-7 w-12" />
|
|
|
|
|
<Skeleton className="h-4 w-24" />
|
2026-02-08 14:37:32 +01:00
|
|
|
</div>
|
2026-01-30 13:41:32 +01:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
2026-02-10 23:08:00 +01:00
|
|
|
{/* Progress bar skeleton */}
|
|
|
|
|
<Card className="overflow-hidden">
|
|
|
|
|
<div className="h-1 w-full bg-muted" />
|
|
|
|
|
<CardContent className="py-5 px-6">
|
|
|
|
|
<div className="flex items-center justify-between mb-3">
|
|
|
|
|
<Skeleton className="h-4 w-36" />
|
|
|
|
|
<Skeleton className="h-7 w-16" />
|
|
|
|
|
</div>
|
|
|
|
|
<Skeleton className="h-3 w-full rounded-full" />
|
2026-01-30 13:41:32 +01:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
2026-02-10 23:08:00 +01:00
|
|
|
{/* Two-column skeleton */}
|
2026-02-08 14:37:32 +01:00
|
|
|
<div className="grid gap-6 lg:grid-cols-12">
|
|
|
|
|
<div className="lg:col-span-7">
|
|
|
|
|
<Card>
|
2026-02-10 23:08:00 +01:00
|
|
|
<CardHeader className="pb-3">
|
|
|
|
|
<Skeleton className="h-5 w-40" />
|
2026-02-08 14:37:32 +01:00
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
{[...Array(4)].map((_, i) => (
|
2026-02-10 23:08:00 +01:00
|
|
|
<div key={i} className="flex items-center justify-between py-2">
|
|
|
|
|
<div className="space-y-2">
|
2026-02-08 14:37:32 +01:00
|
|
|
<Skeleton className="h-4 w-48" />
|
|
|
|
|
<Skeleton className="h-3 w-32" />
|
|
|
|
|
</div>
|
|
|
|
|
<Skeleton className="h-7 w-20" />
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
2026-02-10 23:08:00 +01:00
|
|
|
<div className="lg:col-span-5 space-y-6">
|
|
|
|
|
<Card className="overflow-hidden">
|
|
|
|
|
<div className="h-1 w-full bg-muted" />
|
|
|
|
|
<CardHeader className="pb-3">
|
|
|
|
|
<Skeleton className="h-5 w-44" />
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<Skeleton className="h-28 w-full rounded-xl" />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
2026-02-08 14:37:32 +01:00
|
|
|
<Card>
|
2026-02-10 23:08:00 +01:00
|
|
|
<CardHeader className="pb-3">
|
|
|
|
|
<Skeleton className="h-5 w-36" />
|
2026-02-08 14:37:32 +01:00
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
2026-02-10 23:08:00 +01:00
|
|
|
{[...Array(2)].map((_, i) => (
|
|
|
|
|
<div key={i} className="space-y-2">
|
|
|
|
|
<Skeleton className="h-4 w-full" />
|
|
|
|
|
<Skeleton className="h-2 w-full rounded-full" />
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
2026-02-08 14:37:32 +01:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-30 13:41:32 +01:00
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default async function JuryDashboardPage() {
|
|
|
|
|
const session = await auth()
|
|
|
|
|
|
|
|
|
|
return (
|
2026-02-11 01:26:19 +01:00
|
|
|
<div className="space-y-4">
|
2026-01-30 13:41:32 +01:00
|
|
|
{/* Header */}
|
2026-02-10 23:08:00 +01:00
|
|
|
<div className="relative">
|
|
|
|
|
<div className="absolute -top-6 -left-6 -right-6 h-32 bg-gradient-to-b from-brand-blue/[0.03] to-transparent dark:from-brand-blue/[0.06] pointer-events-none rounded-xl" />
|
|
|
|
|
<div className="relative">
|
|
|
|
|
<h1 className="text-2xl font-bold tracking-tight text-brand-blue dark:text-foreground">
|
|
|
|
|
{getGreeting()}, {session?.user?.name || 'Juror'}
|
|
|
|
|
</h1>
|
|
|
|
|
<p className="text-muted-foreground mt-0.5">
|
|
|
|
|
Here's an overview of your evaluation progress
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-01-30 13:41:32 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Content */}
|
|
|
|
|
<Suspense fallback={<DashboardSkeleton />}>
|
|
|
|
|
<JuryDashboardContent />
|
|
|
|
|
</Suspense>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|