(text: string, width: number)
| 27 | } |
| 28 | |
| 29 | function truncateToWidth(text: string, width: number): string { |
| 30 | if (width <= 0) return '' |
| 31 | if (text.length <= width) return text |
| 32 | return text.slice(0, width - 1) + '…' |
| 33 | } |
| 34 | |
| 35 | export const extractDomain = (url: string): string => { |
| 36 | try { |