| 40 | } |
| 41 | |
| 42 | func (v *PulumiView) HandleKey(key string) PulumiEvent { |
| 43 | switch key { |
| 44 | case "up": |
| 45 | if v.ActiveSection == PulumiSectionContent { |
| 46 | v.ActiveSection = PulumiSectionHeader |
| 47 | } |
| 48 | case "down": |
| 49 | if v.ActiveSection == PulumiSectionHeader { |
| 50 | v.ActiveSection = PulumiSectionContent |
| 51 | } |
| 52 | case "left": |
| 53 | if v.ActiveSection == PulumiSectionHeader { |
| 54 | return PulumiEventPrevView |
| 55 | } |
| 56 | case "right": |
| 57 | if v.ActiveSection == PulumiSectionHeader { |
| 58 | return PulumiEventNextView |
| 59 | } |
| 60 | case "esc": |
| 61 | return PulumiEventQuit |
| 62 | } |
| 63 | return PulumiEventNone |
| 64 | } |
| 65 | |
| 66 | func (v *PulumiView) Render(active bool, version string) string { |
| 67 | headerFocused := active && v.ActiveSection == PulumiSectionHeader |