fix: make empty text responsive

Signed-off-by: Hadi <hadi@example.com>
This commit is contained in:
Hadi
2026-05-29 11:13:57 +02:00
parent 1aa4b92bb3
commit 4922f3704d
9 changed files with 22 additions and 14 deletions
+8
View File
@@ -14,6 +14,14 @@ func Truncate(s string, max int) string {
return s[:max-1] + "…"
}
// EmptyState renders centered placeholder lines, word-wrapping to fit maxW.
func EmptyState(maxW int, lines ...string) string {
return lipgloss.NewStyle().
Width(maxW).
AlignHorizontal(lipgloss.Center).
Render(strings.Join(lines, "\n"))
}
// CenterLines centers each line horizontally relative to the longest one.
func CenterLines(lines ...string) string {
maxWidth := 0