import React, { useState, useEffect } from 'react'; const STAGE_INFO = { DATA_PIPELINE: { label: 'Data Pipeline', description: 'Loading 16 years of PJM hourly energy readings, scanning for gaps and outliers, ' + 'then fitting a SARIMA statistical model to establish a classical baseline forecast.', estimatedSeconds: '15 – 25s', }, CHRONOS_INFERENCE: { label: 'Chronos Inference', description: 'Running the native zero-shot Amazon Chronos-2 model (120M parameters) via PyTorch ' + 'to generate probabilistic forecasts with p10 / p50 / p90 confidence intervals.', estimatedSeconds: '10 – 20s', }, AGENT_REASONING: { label: 'LangGraph Agent', description: 'Executing the 7-node LangGraph pipeline: divergence analysis, seasonality detection, ' + 'RAG retrieval from the event database, VaR quantification, and mandate synthesis.', estimatedSeconds: '10 – 15s', }, }; const PHASE_ORDER = ['DATA_PIPELINE', 'CHRONOS_INFERENCE', 'AGENT_REASONING']; export function ProgressScreen({ progress }) { const [elapsed, setElapsed] = useState(0); useEffect(() => { const timer = setInterval(() => setElapsed(prev => prev + 1), 1000); return () => clearInterval(timer); }, []); const currentStage = progress.stage || 'DATA_PIPELINE'; const currentPct = progress.progress || 0; const currentInfo = STAGE_INFO[currentStage] || STAGE_INFO.DATA_PIPELINE; const currentPhaseIdx = PHASE_ORDER.indexOf(currentStage); return (

Executing GridOps AI Pipeline

{currentInfo.description}

ETA: 1.5 – 2.5 minutes
{/* Step progress */}
{PHASE_ORDER.map((key, i) => { const info = STAGE_INFO[key]; const isDone = i < currentPhaseIdx; const isActive = i === currentPhaseIdx; const isPending = i > currentPhaseIdx; return (
{/* Status dot */}
{isDone && ( )} {isActive && ( )}
{/* Text */}
{info.label} {isActive && ( {currentPct}% )} {isDone && ( Complete )} {isPending && ( {info.estimatedSeconds} )}

{info.description}

); })}
{/* Progress bar */}
{/* Elapsed timer */}
{Math.floor(elapsed / 60)}:{(elapsed % 60).toString().padStart(2, '0')}
{progress.message || 'Initializing pipeline…'}
); }