1package header
 2
 3import (
 4	"strings"
 5
 6	tea "github.com/charmbracelet/bubbletea"
 7	"github.com/charmbracelet/soft-serve/server/ui/common"
 8)
 9
10// Header represents a header component.
11type Header struct {
12	common common.Common
13	text   string
14}
15
16// New creates a new header component.
17func New(c common.Common, text string) *Header {
18	return &Header{
19		common: c,
20		text:   text,
21	}
22}
23
24// SetSize implements common.Component.
25func (h *Header) SetSize(width, height int) {
26	h.common.SetSize(width, height)
27}
28
29// Init implements tea.Model.
30func (h *Header) Init() tea.Cmd {
31	return nil
32}
33
34// Update implements tea.Model.
35func (h *Header) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
36	return h, nil
37}
38
39// View implements tea.Model.
40func (h *Header) View() string {
41	return h.common.Styles.ServerName.Render(strings.TrimSpace(h.text))
42}