WIP
This commit is contained in:
34
internal/components/multiPageForm.go
Normal file
34
internal/components/multiPageForm.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package components
|
||||
|
||||
import (
|
||||
tea "charm.land/bubbletea/v2"
|
||||
"charm.land/huh/v2"
|
||||
)
|
||||
|
||||
type Page struct {
|
||||
form huh.Form
|
||||
}
|
||||
|
||||
type MultiPageForm struct {
|
||||
// pages []Page
|
||||
form huh.Form
|
||||
}
|
||||
|
||||
func NewMultiPageForm(form huh.Form) *MultiPageForm {
|
||||
return &MultiPageForm{
|
||||
form: form,
|
||||
}
|
||||
}
|
||||
|
||||
func (f *MultiPageForm) Init() tea.Cmd {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *MultiPageForm) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
_, cmd := f.form.Update(msg)
|
||||
return f, cmd
|
||||
}
|
||||
|
||||
func (f *MultiPageForm) View() tea.View {
|
||||
return tea.NewView(f.form.View())
|
||||
}
|
||||
Reference in New Issue
Block a user