Render renders the tab bar.
()
| 154 | |
| 155 | // Render renders the tab bar. |
| 156 | func (t *TabBar) Render() string { |
| 157 | if len(t.entries) == 0 { |
| 158 | // No PRDs - show just the "+ New" button |
| 159 | newTab := TabNewStyle.Render("+ New") |
| 160 | return newTab |
| 161 | } |
| 162 | |
| 163 | var tabs []string |
| 164 | |
| 165 | for i, entry := range t.entries { |
| 166 | tab := t.renderTab(entry, i+1) |
| 167 | tabs = append(tabs, tab) |
| 168 | } |
| 169 | |
| 170 | // Add the "+ New" tab |
| 171 | newTab := TabNewStyle.Render("+ New") |
| 172 | tabs = append(tabs, newTab) |
| 173 | |
| 174 | // Join tabs with small spacing |
| 175 | return lipgloss.JoinHorizontal(lipgloss.Top, tabs...) |
| 176 | } |
| 177 | |
| 178 | // renderTab renders a single tab. |
| 179 | func (t *TabBar) renderTab(entry TabEntry, number int) string { |
no test coverage detected