generated from charmbracelet/bubbletea-app-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.go
63 lines (52 loc) · 1010 Bytes
/
main.go
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
/*
Qs
- don't need to store list of Items and data structure - should be able to wrap each of them when necessary
- cast it as type, modify it, sub it back in as interface
*/
/* functionality
- add tasks to current list
- edit selected task
*/
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)
type (
status uint
page int
)
const (
todo status = iota
inProgress
done
)
const (
tasks page = iota
input
)
const (
divisor = 4
)
var (
models []tea.Model
columnStyle = lipgloss.NewStyle().
Padding(1, 2).
Border(lipgloss.HiddenBorder())
focusedStyle = lipgloss.NewStyle().
Padding(1, 2).
Border(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("62"))
helpStyle = lipgloss.NewStyle().
Foreground(lipgloss.Color("241"))
)
func main() {
models = []tea.Model{newModel(), newForm(todo)}
p := tea.NewProgram(models[tasks])
if err := p.Start(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}