gspot/src/components/tui/tui.go

21 lines
425 B
Go
Raw Normal View History

2024-02-18 23:04:34 +00:00
package tui
import (
tea "github.com/charmbracelet/bubbletea"
2024-02-19 02:51:25 +00:00
"git.asdf.cafe/abs3nt/gspot/src/components/commands"
2024-02-18 23:04:34 +00:00
)
// StartTea the entry point for the UI. Initializes the model.
func StartTea(cmd *commands.Commander, mode string) error {
m, err := InitMain(cmd, Mode(mode))
if err != nil {
return err
}
P = tea.NewProgram(m, tea.WithAltScreen())
if _, err := P.Run(); err != nil {
return err
}
return nil
}