Files
LazyPM/pkg/tui/components/header.go
Robin Olsen 3e9a903506 works now
2026-03-18 11:58:31 +01:00

30 lines
464 B
Go

package components
import (
"charm.land/lipgloss/v2"
"github.com/LazyBachelor/LazyPM/pkg/tui/styles"
)
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("─"),
)
}
func (h Header) Height() int {
return 1
}