| 123 | } |
| 124 | |
| 125 | func (m InstallModel) RenderView() string { |
| 126 | var b strings.Builder |
| 127 | |
| 128 | for i := range m.inputs { |
| 129 | b.WriteString(m.inputs[i].View()) |
| 130 | if i < len(m.inputs)-1 { |
| 131 | b.WriteRune('\n') |
| 132 | } |
| 133 | } |
| 134 | button := &blurredButton |
| 135 | if m.focusIndex == len(m.inputs) { |
| 136 | button = &focusedButton |
| 137 | } |
| 138 | fmt.Fprintf(&b, "\n\n%s\n\n", *button) |
| 139 | |
| 140 | b.WriteString(helpStyle.Render("Use the arrow keys to navigate. Press enter to submit.")) |
| 141 | return b.String() |
| 142 | } |
| 143 | |
| 144 | func (m InstallModel) View() string { |
| 145 | val := m.RenderView() |