(item: RunFooterMenuItem)
| 208 | return " ".repeat(Math.max(1, descriptionColumn() - Bun.stringWidth(item.display))) |
| 209 | } |
| 210 | const descriptionText = (item: RunFooterMenuItem) => { |
| 211 | if (!item.description) { |
| 212 | return |
| 213 | } |
| 214 | |
| 215 | const footerWidth = item.footer ? Bun.stringWidth(item.footer) + 1 : 0 |
| 216 | const available = |
| 217 | term().width - |
| 218 | (border() ? 1 : 0) - |
| 219 | (props.paddingLeft ?? 1) - |
| 220 | (props.paddingRight ?? 0) - |
| 221 | descriptionColumn() - |
| 222 | footerWidth - |
| 223 | 4 |
| 224 | return Locale.truncate(item.description, Math.max(12, available)) |
| 225 | } |
| 226 | return ( |
| 227 | <box |
| 228 | width="100%" |
no test coverage detected