Files
music_player/components/sidebar.go
vaibhav b92b173815 Add sidebar component
Introduce a new `Sidebar` component to encapsulate sidebar logic and
rendering. This component utilizes Bubble Tea and Lipgloss for UI
elements. The main application now integrates this component for
displaying sidebar content.
2026-01-16 02:05:12 +05:30

30 lines
460 B
Go

package components
import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)
type Sidebar struct {
data string
}
func (s Sidebar) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch m := msg.(type) {
case tea.KeyMsg:
switch m.String() {
case "up":
}
}
}
func (s Sidebar) View() string {
sidebar := lipgloss.
NewStyle().
BorderStyle(lipgloss.NormalBorder()).
Padding(1, 2).
Render(s.data)
return sidebar
}