Add edit mode toggle and entry activation

This commit is contained in:
Philip Henning 2025-08-13 16:39:39 +02:00
parent 0c60248d75
commit 51966f766c
6 changed files with 69 additions and 17 deletions

View file

@ -47,7 +47,11 @@ func (m Model) View() string {
// join panes and status bar
panes := lipgloss.JoinHorizontal(lipgloss.Top, left, right)
status := fmt.Sprintf("VIEW MODE • %d entries", len(m.hosts.Entries))
modeLabel := "VIEW"
if m.mode == EditMode {
modeLabel = "EDIT"
}
status := fmt.Sprintf("%s MODE • %d entries", modeLabel, len(m.hosts.Entries))
bar := statusStyle.Width(m.width).Render(status)
return lipgloss.JoinVertical(lipgloss.Left, panes, bar)
}