refactored render to internal/render added logging with charmbracelet/log
This commit is contained in:
parent
109c54f1e5
commit
6f0b534d8d
20 changed files with 356 additions and 13 deletions
18
Output/tui/update.go
Normal file
18
Output/tui/update.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package tui
|
||||
|
||||
import tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
switch msg := msg.(type) {
|
||||
case tea.KeyMsg:
|
||||
switch msg.String() {
|
||||
case "q", "ctrl+c":
|
||||
return m, tea.Quit
|
||||
case "up":
|
||||
m.count++
|
||||
case "down":
|
||||
m.count--
|
||||
}
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue