(percentRemaining: number)
| 149 | } |
| 150 | |
| 151 | function renderProgressBar(percentRemaining: number): string { |
| 152 | const ratio = Math.max(0, Math.min(100, percentRemaining)) / 100 |
| 153 | const filled = Math.round(ratio * BAR_SEGMENTS) |
| 154 | const empty = BAR_SEGMENTS - filled |
| 155 | return `[${BAR_FILLED.repeat(filled)}${BAR_EMPTY.repeat(empty)}]` |
| 156 | } |
| 157 | |
| 158 | function formatReset(resetsAtSeconds: number | undefined, now: number): string | undefined { |
| 159 | if (!resetsAtSeconds) return undefined |