mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-07-06 20:42:33 +02:00
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user