import { Suspense } from 'react' import Link from 'next/link' import { api } from '@/lib/trpc/server' import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Skeleton } from '@/components/ui/skeleton' import { Plus, FileText, Video, Link as LinkIcon, File, Eye, Pencil, ExternalLink, } from 'lucide-react' import { formatDate } from '@/lib/utils' const resourceTypeIcons = { PDF: FileText, VIDEO: Video, DOCUMENT: File, LINK: LinkIcon, OTHER: File, } const cohortColors = { ALL: 'bg-gray-100 text-gray-800', SEMIFINALIST: 'bg-blue-100 text-blue-800', FINALIST: 'bg-purple-100 text-purple-800', } async function LearningResourcesList() { const caller = await api() const { data: resources } = await caller.learningResource.list({ perPage: 50, }) if (resources.length === 0) { return (

No resources yet

Start by adding your first learning resource

) } return (
{resources.map((resource) => { const Icon = resourceTypeIcons[resource.resourceType] return (

{resource.title}

{!resource.isPublished && ( Draft )}
{resource.cohortLevel} {resource.resourceType} - {resource._count.accessLogs} views
{resource.externalUrl && ( )}
) })}
) } function LoadingSkeleton() { return (
{[1, 2, 3].map((i) => (
))}
) } export default function LearningHubPage() { return (

Learning Hub

Manage educational resources for jury members

}>
) }