discordo/internal/ui/modal.go

18 lines
333 B
Go

package ui
import "github.com/ayn2op/tview"
type ModalButton struct {
Label string
Cmd tview.Cmd
KeepOpen bool
}
type ModalMsg struct {
Text string
Buttons []ModalButton
}
func ShowModal(text string, buttons ...ModalButton) tview.Cmd {
return func() tview.Msg { return ModalMsg{Text: text, Buttons: buttons} }
}