// The queue gap's words (jobs/queueGap.ts), client-safe: no node imports, so // the /jobs row can count a waiting job down. // "5 min", "20 s", "1 h", "1 h 30 min". export function spanText(seconds: number): string { if (seconds < 60) return `${seconds} s`; if (seconds < 3600) { const m = Math.floor(seconds / 60); const s = seconds % 60; return s ? `${m} min ${s} s` : `${m} min`; } const h = Math.floor(seconds / 3600); const m = Math.round((seconds % 3600) / 60); return m ? `${h} h ${m} min` : `${h} h`; } // "4m12s", "45s", "1h02m". export function waitText(ms: number): string { const total = Math.max(0, Math.ceil(ms / 1000)); const h = Math.floor(total / 3600); const m = Math.floor((total % 3600) / 60); const s = total % 60; if (h) return `${h}h${String(m).padStart(2, "0")}m`; if (m) return `${m}m${String(s).padStart(2, "0")}s`; return `${s}s`; }