tui.go 579 B

123456789101112131415161718192021222324252627282930313233343536
  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. var output string
  23. output = output + fmt.Sprintf("%v", m.Bug)
  24. // title
  25. // status
  26. // variadics
  27. // description
  28. return output
  29. }