(value: string, width: number)
| 123 | } |
| 124 | |
| 125 | function ellipsize(value: string, width: number) { |
| 126 | if (value.length <= width) return value |
| 127 | if (width <= 1) return value.slice(0, width) |
| 128 | return value.slice(0, width - 1) + "…" |
| 129 | } |
| 130 | |
| 131 | function wrapText(value: string, width: number) { |
| 132 | if (!value) return [""] |