change signature of interfaces to fit Interface interface

This commit is contained in:
Robin Olsen
2026-02-12 19:57:52 +01:00
parent 0b840f87d8
commit 08ded5384c
4 changed files with 35 additions and 9 deletions

View File

@@ -10,16 +10,24 @@ import (
type TUIConfig = service.Config
func Run(ctx context.Context, config TUIConfig) (tea.Model, error) {
type Tui struct{}
func NewTui() *Tui {
return &Tui{}
}
func (t *Tui) Run(ctx context.Context, config TUIConfig) error {
svc, cleanup, err := service.NewServices(ctx, config)
if err != nil {
return nil, err
return nil
}
defer cleanup()
app := tea.NewProgram(views.NewDashboardView(svc),
tea.WithAltScreen(), tea.WithMouseAllMotion())
if _, err := tea.NewProgram(views.NewDashboardView(svc),
tea.WithAltScreen(), tea.WithMouseAllMotion()).Run(); err != nil {
return err
}
return app.Run()
return nil
}