| 27 | } |
| 28 | |
| 29 | func NewInstallModel(p string) InstallModel { |
| 30 | m := InstallModel{ |
| 31 | inputs: make([]textinput.Model, 3), |
| 32 | } |
| 33 | var t textinput.Model |
| 34 | for i := range m.inputs { |
| 35 | t = textinput.New() |
| 36 | t.CursorStyle = cursorStyle |
| 37 | t.CharLimit = 50 |
| 38 | |
| 39 | switch i { |
| 40 | case 0: |
| 41 | t.Placeholder = "~/.config/" + p |
| 42 | t.Focus() |
| 43 | t.PromptStyle = focusedStyle |
| 44 | t.TextStyle = focusedStyle |
| 45 | case 1: |
| 46 | t.Placeholder = "~/.config/" + p |
| 47 | case 2: |
| 48 | t.Placeholder = "%appdata%/" + p |
| 49 | } |
| 50 | m.inputs[i] = t |
| 51 | } |
| 52 | return m |
| 53 | } |
| 54 | |
| 55 | func (m InstallModel) Init() tea.Cmd { |
| 56 | return textinput.Blink |