import { useEffect, useState } from 'react'; interface Step { label: string; status: 'pending' | 'active' | 'done'; pct: number; } const PHASES = [ { stepIdx: 0, pct: 20 }, { stepIdx: 1, pct: 40 }, { stepIdx: 2, pct: 65 }, { stepIdx: 3, pct: 85 }, { stepIdx: 4, pct: 98 }, ]; const STEP_LABELS = [ 'Extracting frames...', 'Detecting faces...', 'Running ViT inference...', 'Analyzing audio...', 'Generating report...', ]; const P = 'rgba(168,85,247,'; export default function ProcessingSection() { const [steps, setSteps] = useState( STEP_LABELS.map(label => ({ label, status: 'pending', pct: 0 })) ); const [overallPct, setOverallPct] = useState(0); const [phaseIdx, setPhaseIdx] = useState(0); useEffect(() => { const interval = setInterval(() => { setPhaseIdx(prev => { const next = prev + 1; if (next >= PHASES.length) { clearInterval(interval); return prev; } return next; }); }, 2200); return () => clearInterval(interval); }, []); useEffect(() => { const phase = PHASES[phaseIdx]; setOverallPct(phase.pct); setSteps(prev => prev.map((s, i) => { if (i < phase.stepIdx) return { ...s, status: 'done', pct: 100 }; if (i === phase.stepIdx) return { ...s, status: 'active', pct: phase.pct }; return { ...s, status: 'pending', pct: 0 }; })); }, [phaseIdx]); const stepColor = (s: Step) => s.status === 'active' ? '#c084fc' : s.status === 'done' ? '#a855f7' : 'rgba(168,85,247,0.25)'; const stepIcon = (s: Step) => s.status === 'active' ? 'sync' : s.status === 'done' ? 'check_circle' : 'hourglass_empty'; return (
{/* Purple scan line */}
{/* Header */}

SYSTEM_STATE: ANALYSIS

Initiating Deep Inspection Protocol

{/* Bento grid */}
{/* Left: Orb */}
Target Vector
analytics
troubleshoot
{[ { label: 'DATA_STREAM', value: 'ACTIVE', valueColor: '#a855f7' }, { label: 'THROUGHPUT', value: '2.4 TB/s', valueColor: '#818cf8' }, ].map(({ label, value, valueColor }) => (
{label} {value}
))}
{/* Right: Pipeline */}
Processing Pipeline {overallPct}% COMPLETE
{steps.map((step, i) => (
{stepIcon(step)} {step.label}
{step.status === 'done' ? '100%' : step.status === 'active' ? `${step.pct}%` : '0%'}
{Array.from({ length: 10 }).map((_, j) => { const filled = step.status === 'done' || (step.status === 'active' && j < Math.round(step.pct / 10)); return (
); })}
))}
{/* Overall progress */}
Overall Progress {overallPct}%
); }