package pages
import (
"github.com/b2dennis/meshi/ui/components/table"
"github.com/b2dennis/meshi/ui/components/card"
"github.com/b2dennis/meshi/xlsx"
)
var weekdays = []string{
"Sonntag",
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag",
}
templ Home(plan xlsx.Plan) {
Menüplan
@card.Card(card.Props{Class: "w-4/5 h-4/5"}) {
@table.Table() {
@table.Header() {
@table.Row() {
@table.Head() {
Tag
}
@table.Head() {
Frühstück
}
@table.Head() {
Mittagessen
}
@table.Head() {
Abendessen
}
}
}
for i := 0; i <= 6; i++ {
{{
class := ""
if i == 6 {
class = "border-b-0"
}
}}
@table.Row(table.RowProps{Class: class}) {
@table.Cell() {
{weekdays[plan[i][0].Date.Weekday()]}, {plan[i][0].Date.Format("02.01.2006")}
}
for _, menu := range plan[i] {
@table.Cell() {
{menu.Text}
}
}
}
}
}
}
}