import styles from './DeploymentProgress.module.css'; const STAGES = [ { key: 'PRE_FLIGHT', label: 'Prepare' }, { key: 'PULL_IMAGE', label: 'Image' }, { key: 'CREATE_NETWORK', label: 'Network' }, { key: 'START_REPLICAS', label: 'Launch' }, { key: 'HEALTH_CHECK', label: 'Verify' }, { key: 'SWAP_TRAFFIC', label: 'Activate' }, { key: 'COMPLETE', label: 'Live' }, ]; interface DeploymentProgressProps { currentStage: string | null; failed?: boolean; } export function DeploymentProgress({ currentStage, failed }: DeploymentProgressProps) { if (!currentStage) return null; const currentIndex = STAGES.findIndex((s) => s.key === currentStage); return (
{STAGES.map((stage, i) => { const isCompleted = i < currentIndex; const isActive = i === currentIndex && !failed; const isFailed = i === currentIndex && failed; return (
{isCompleted && ( )}
{stage.label}
); })}
); }