(authURL string)
| 70 | } |
| 71 | |
| 72 | func NewLoginModel(authURL string) LoginModel { |
| 73 | s := NewPrimarySpinner() |
| 74 | styles := newLoginStyles() |
| 75 | |
| 76 | ti := textinput.New() |
| 77 | ti.Placeholder = "Enter your Thunder Compute token..." |
| 78 | ti.CharLimit = 500 |
| 79 | ti.Width = 50 |
| 80 | ti.Focus() |
| 81 | ti.PromptStyle = PrimaryCursorStyle() |
| 82 | ti.TextStyle = PrimaryCursorStyle() |
| 83 | ti.PlaceholderStyle = SubtleTextStyle() |
| 84 | ti.Cursor.Style = PrimaryCursorStyle() |
| 85 | |
| 86 | return LoginModel{ |
| 87 | state: LoginStateWaiting, |
| 88 | authURL: authURL, |
| 89 | spinner: s, |
| 90 | tokenInput: ti, |
| 91 | width: 80, |
| 92 | styles: styles, |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | func (m LoginModel) Init() tea.Cmd { |
| 97 | return m.spinner.Tick |
no test coverage detected