package main import ( "citrons.xyz/talk/tui" ) type loginPrompt struct { input tui.TextInput username string } func (p *loginPrompt) Input() *tui.TextInput { return &p.input } func (p *loginPrompt) Send(text string) { if p.username != "" { return } p.username = text globalApp.auth(text, func(success bool) { if success { globalApp.removePrompt(p) } else { p.username = "" } }) } func (p *loginPrompt) ShowStatusLine() { tui.Text("[", nil) tui.Text("login", &tui.Style { Bg: tui.White, Fg: tui.Blue, Bold: true, }) tui.Text("]", nil) tui.Text(" username:", nil) }