Files
LazyPM/pkg/tui/components/header.go
2026-03-22 14:02:19 +01:00

31 lines
513 B
Go

package components
import (
"charm.land/lipgloss/v2"
"github.com/LazyBachelor/LazyPM/internal/style"
)
type Header struct {
Title string
}
func NewHeader(title string) Header {
return Header{Title: title}
}
func (h Header) View(width int) string {
title := style.HeaderTitleStyle.Render(h.Title)
return lipgloss.PlaceHorizontal(
width,
lipgloss.Left,
title,
lipgloss.WithWhitespaceChars("─"),
lipgloss.WithWhitespaceStyle(style.TitleStyle),
)
}
func (h Header) Height() int {
return 1
}