-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathmodels.go
More file actions
44 lines (39 loc) · 833 Bytes
/
Copy pathmodels.go
File metadata and controls
44 lines (39 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package render
import (
api "github.com/bootdotdev/bootdev/client"
"github.com/charmbracelet/bubbles/spinner"
)
type testModel struct {
text string
passed *bool
finished bool
}
type stepModel struct {
step string
passed *bool
result *api.CLIStepResult
finished bool
tests []testModel
sleepAfter string
noPenaltyOnFail bool
}
type rootModel struct {
steps []stepModel
spinner spinner.Model
result api.VerificationResultSlug
failure *api.StructuredErrCLI
xpReward int
xpBreakdown []api.XPBreakdownItem
isSubmit bool
finalized bool
clear bool
}
func initModel(isSubmit bool) rootModel {
s := spinner.New()
s.Spinner = spinner.Dot
return rootModel{
spinner: s,
isSubmit: isSubmit,
steps: []stepModel{},
}
}