1package anim
2
3import (
4 "image/color"
5
6 tea "github.com/charmbracelet/bubbletea/v2"
7 "github.com/charmbracelet/lipgloss/v2"
8)
9
10type noAnim struct {
11 Color color.Color
12 rendered string
13}
14
15func newStatic(label string, foreground color.Color) Spinner {
16 a := &noAnim{Color: foreground}
17 a.SetLabel(label)
18 return a
19}
20
21func (s *noAnim) SetLabel(label string) {
22 s.rendered = lipgloss.NewStyle().Foreground(s.Color).Render(label + ellipsisFrames[2])
23}
24
25func (s noAnim) Init() tea.Cmd { return nil }
26func (s *noAnim) Update(tea.Msg) (Spinner, tea.Cmd) { return s, nil }
27func (s *noAnim) View() string { return s.rendered }