'use client' import Link from 'next/link' import type { Route } from 'next' import { trpc } from '@/lib/trpc/client' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from '@/components/ui/card' import { Skeleton } from '@/components/ui/skeleton' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' import { Plus, MoreHorizontal, Eye, Edit, Layers, GitBranch, Calendar, } from 'lucide-react' import { cn } from '@/lib/utils' import { format } from 'date-fns' import { useEdition } from '@/contexts/edition-context' const statusColors: Record = { DRAFT: 'bg-gray-100 text-gray-700', ACTIVE: 'bg-emerald-100 text-emerald-700', ARCHIVED: 'bg-muted text-muted-foreground', CLOSED: 'bg-blue-100 text-blue-700', } export default function PipelineListPage() { const { currentEdition } = useEdition() const programId = currentEdition?.id const { data: pipelines, isLoading } = trpc.pipeline.list.useQuery( { programId: programId! }, { enabled: !!programId } ) if (!programId) { return (

Pipelines

Select an edition to view pipelines

No Edition Selected

Select an edition from the sidebar to view its pipelines

) } return (
{/* Header */}

Pipelines

Manage evaluation pipelines for {currentEdition?.name}

{/* Loading */} {isLoading && (
{[1, 2, 3].map((i) => ( ))}
)} {/* Empty State */} {!isLoading && (!pipelines || pipelines.length === 0) && (

No Pipelines Yet

Create your first pipeline to start managing project evaluation

)} {/* Pipeline Cards */} {pipelines && pipelines.length > 0 && (
{pipelines.map((pipeline) => (
{pipeline.name} {pipeline.slug}
{pipeline.status} View Edit
{pipeline._count.tracks} tracks
{pipeline._count.routingRules} rules

Created {format(new Date(pipeline.createdAt), 'MMM d, yyyy')}

))}
)}
) }