mirror of
https://github.com/Valkyrie00/bold-brew.git
synced 2026-03-14 22:35:53 +01:00
31 lines
565 B
Go
31 lines
565 B
Go
package components
|
|
|
|
import (
|
|
"bbrew/internal/ui/theme"
|
|
"fmt"
|
|
"github.com/rivo/tview"
|
|
)
|
|
|
|
type Header struct {
|
|
view *tview.TextView
|
|
theme *theme.Theme
|
|
}
|
|
|
|
func NewHeader(theme *theme.Theme) *Header {
|
|
header := &Header{
|
|
view: tview.NewTextView(),
|
|
theme: theme,
|
|
}
|
|
|
|
header.view.SetDynamicColors(true)
|
|
header.view.SetTextAlign(tview.AlignLeft)
|
|
return header
|
|
}
|
|
|
|
func (h *Header) Update(name, version, brewVersion string) {
|
|
h.view.SetText(fmt.Sprintf(" %s %s - %s", name, version, brewVersion))
|
|
}
|
|
|
|
func (h *Header) View() *tview.TextView {
|
|
return h.view
|
|
}
|