(text: string, maxLen: number)
| 85 | |
| 86 | // Truncate text to fit single line |
| 87 | const truncateText = (text: string, maxLen: number): string => { |
| 88 | const singleLine = text.replace(/\n/g, ' ').trim() |
| 89 | if (singleLine.length <= maxLen) return singleLine |
| 90 | return singleLine.slice(0, maxLen - 1) + '…' |
| 91 | } |
| 92 | |
| 93 | // Pad text to fixed width (right-pad with spaces) |
| 94 | const padRight = (text: string, width: number): string => { |