export const FORGE_INITIAL_STAGE = 'Initializing forge...'; interface Props { building: boolean; stage: string; progress: number; } /** True while waiting for the first server-reported forge stage. */ export function isForgeProgressIndeterminate(stage: string, progress: number): boolean { return progress === 0 && (stage === '' || stage === FORGE_INITIAL_STAGE); } export default function ForgeProgressBar({ building, stage, progress }: Props) { if (!building) return null; const indeterminate = isForgeProgressIndeterminate(stage, progress); const displayStage = stage || 'Initializing...'; const pctLabel = indeterminate ? '…' : `${Math.round(progress)}%`; return (
{displayStage} {pctLabel}
{!indeterminate && (
)}
); }