tui.go 431 B

1234567891011121314151617181920212223242526272829
  1. // TODO Implement Bubbletea
  2. package buggo
  3. import (
  4. "fmt"
  5. tea "github.com/charmbracelet/bubbletea"
  6. )
  7. // The main bubbletea Model
  8. type Model struct {
  9. Bug Bug
  10. Path string
  11. }
  12. func (m Model) Init() tea.Cmd { return nil }
  13. func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
  14. switch msg.(type) {
  15. case tea.KeyMsg:
  16. return m, tea.Quit
  17. }
  18. return m, nil
  19. }
  20. func (m Model) View() string {
  21. return fmt.Sprintf("%v", m.Bug)
  22. }