'use client' import Link from 'next/link' import { trpc } from '@/lib/trpc/client' import { Card, CardContent } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { CircleDot, AlertTriangle, Upload, UserPlus, } from 'lucide-react' import { GeographicSummaryCard } from '@/components/charts' import { AnimatedCard } from '@/components/shared/animated-container' import { motion } from 'motion/react' import { CompetitionPipeline } from '@/components/dashboard/competition-pipeline' import { RoundStats } from '@/components/dashboard/round-stats' import { ActiveRoundPanel } from '@/components/dashboard/active-round-panel' import { SmartActions } from '@/components/dashboard/smart-actions' import { ProjectListCompact } from '@/components/dashboard/project-list-compact' import { ActivityFeed } from '@/components/dashboard/activity-feed' import { CategoryBreakdown } from '@/components/dashboard/category-breakdown' import { DashboardSkeleton } from '@/components/dashboard/dashboard-skeleton' type DashboardContentProps = { editionId: string sessionName: string } export function DashboardContent({ editionId, sessionName }: DashboardContentProps) { const { data, isLoading, error } = trpc.dashboard.getStats.useQuery( { editionId }, { enabled: !!editionId, retry: 1, refetchInterval: 30_000 } ) if (isLoading) { return } if (error) { return (

Failed to load dashboard

{error.message || 'An unexpected error occurred. Please try refreshing the page.'}

) } if (!data) { return (

Edition not found

The selected edition could not be found

) } const { edition, pipelineRounds, activeRoundId, nextActions, projectCount, newProjectsThisWeek, totalJurors, activeJurors, evaluationStats, totalAssignments, latestProjects, categoryBreakdown, oceanIssueBreakdown, recentActivity, } = data const activeRound = activeRoundId ? pipelineRounds.find((r) => r.id === activeRoundId) ?? null : null return ( <> {/* Page Header */}

{edition.name} {edition.year}

Welcome back, {sessionName}

{/* Competition Pipeline */} {/* Round-Specific Stats */} {/* Two-Column Layout */}
{/* Left Column */}
{activeRound && ( )}
{/* Right Column */}
{/* Bottom Full Width */}
) }