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 (
{currentInfo.description}
{info.description}