From ca8fc4022f22fd9aa1fad5cc08bbea3f6130b9c4 Mon Sep 17 00:00:00 2001 From: Robin Olsen Date: Tue, 10 Feb 2026 17:50:02 +0100 Subject: [PATCH] add custom header --- pkg/tui/views/dashboard/header.go | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkg/tui/views/dashboard/header.go diff --git a/pkg/tui/views/dashboard/header.go b/pkg/tui/views/dashboard/header.go new file mode 100644 index 0000000..9810188 --- /dev/null +++ b/pkg/tui/views/dashboard/header.go @@ -0,0 +1,32 @@ +package dashboard + +import ( + "github.com/LazyBachelor/LazyPM/pkg/tui/styles" + "github.com/charmbracelet/lipgloss" +) + +type Header struct { + title string +} + +func NewHeader(title string) Header { + return Header{ + title: title, + } +} + +func (h Header) View(width int) string { + title := styles.HeaderTitleStyle.Render(h.title) + + return lipgloss.PlaceHorizontal( + width, + lipgloss.Left, + title, + lipgloss.WithWhitespaceChars("─"), + lipgloss.WithWhitespaceForeground(styles.Primary), + ) +} + +func (h Header) Height() int { + return 2 +}