'use client'; import { motion } from 'framer-motion'; import { CheckCircle as CheckCircle2, XCircle } from '@phosphor-icons/react'; import { fadeUp, fadeIn } from '@/lib/animations'; interface Step { name: string; label: string; } const STEPS: Step[] = [ { name: 'submitted_to_ncbi', label: 'Submitted to NCBI BLAST' }, { name: 'polling_ncbi', label: 'NCBI is searching' }, { name: 'parsing', label: 'Reading results' }, { name: 'interpreting', label: 'Writing your explanation' }, { name: 'fetching_alphafold', label: 'Fetching AlphaFold structure' }, { name: 'complete', label: 'Complete' }, ]; interface JobProgressProps { stepsCompleted: string[]; status: string; } export function JobProgress({ stepsCompleted, status }: JobProgressProps) { const isComplete = status === 'complete'; const isFailed = status === 'failed'; const stepSet = new Set(stepsCompleted); const pct = stepsCompleted.length === 0 ? 0 : Math.round((stepsCompleted.length / STEPS.length) * 100); const nextPendingIndex = stepsCompleted.length; return (

Pipeline progress

{pct}%
{STEPS.map((step, i) => { const done = stepSet.has(step.name); const active = status === 'running' && !done && i === nextPendingIndex; return ( {done ? ( ) : isFailed ? ( ) : active ? (
) : (
)} {step.label} ); })}
{isComplete && (

All steps complete

)} {isFailed && (

Pipeline failed

)} ); }