tui.go 483 B

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