diff --git a/main.go b/main.go index 9baade9..894042c 100644 --- a/main.go +++ b/main.go @@ -10,9 +10,10 @@ import ( ) type model struct { - textInput textinput.Model - width int - height int + textInput textinput.Model + width int + height int + sidebarContent string } func initialModel() model { @@ -23,7 +24,8 @@ func initialModel() model { ti.Prompt = "" ti.Focus() return model{ - textInput: ti, + textInput: ti, + sidebarContent: "Library\n\nPlaylist 1\nPlaylist 2\nFavorites", } } @@ -51,12 +53,22 @@ func (m model) View() string { if m.width == 0 { return "loading..." } + + // Create search box + searchBox := lipgloss.NewStyle().BorderStyle(lipgloss.ThickBorder()).Padding(0, 1).Render(m.textInput.View()) + + // Create sidebar + sidebar := lipgloss.NewStyle().BorderStyle(lipgloss.NormalBorder()).Padding(1, 2).Render(m.sidebarContent) + + // Combine search and sidebar vertically + content := lipgloss.JoinVertical(lipgloss.Left, searchBox, "\n", sidebar) + return lipgloss.Place( m.width, m.height, lipgloss.Center, - 0, - lipgloss.NewStyle().BorderStyle(lipgloss.ThickBorder()).Padding(0, 1).Render(m.textInput.View()), + lipgloss.Center, + content, ) }