doing some filtering and tabwork

This commit is contained in:
june 2025-03-08 11:56:56 +13:00
parent 05a79cd921
commit 5231fd8f6a
Signed by untrusted user who does not match committer: breadone
GPG Key ID: FDC19FE143200483

View File

@ -64,10 +64,29 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (m model) View() string { func (m model) View() string {
// The header // The header
s := "What should we buy at the market?\n\n" s := ""
currentList := []todo{}
switch m.tab {
case 0:
s += "Inbox"
inboxFilter := func(t todo) bool { return t.isInbox}
currentList = filter(m.todos, inboxFilter)
case 1:
s += "Today"
case 2:
s += "Tomorrow"
case 3:
s += "Scheduled"
case 4:
s += "Anytime"
}
s += "\n\n"
// Iterate over our choices // Iterate over our choices
for i, choice := range m.list { for i, choice := range currentList {
// Is the cursor pointing at this choice? // Is the cursor pointing at this choice?
cursor := " " // no cursor cursor := " " // no cursor