| 10 | ) |
| 11 | |
| 12 | func (m MainModel) View() string { |
| 13 | if m.quitting { |
| 14 | return "" |
| 15 | } |
| 16 | |
| 17 | outerStyle := baseStyle. |
| 18 | Width(m.width-2). |
| 19 | Height(m.height-2). |
| 20 | Padding(0, 1) |
| 21 | |
| 22 | switch m.state { |
| 23 | case stateList: |
| 24 | return m.viewList(outerStyle) |
| 25 | case stateDetail: |
| 26 | if m.selectedDetail == nil && m.selectedContainer == nil { |
| 27 | return m.viewDetailLoading(outerStyle) |
| 28 | } |
| 29 | if m.selectedContainer != nil { |
| 30 | return m.viewContainerDetail(outerStyle) |
| 31 | } |
| 32 | return m.viewProcessDetail(outerStyle) |
| 33 | } |
| 34 | return "Unknown state" |
| 35 | } |
| 36 | |
| 37 | func (m MainModel) viewList(outerStyle lipgloss.Style) string { |
| 38 | status := "Mode: Navigation (Press / to search)" |