package main // menuBoardComponent renders a Coffee-styled menu board. templ menuBoardComponent(data MenuBoardData) {
if data.Title != "" {

{ data.Title }

} if len(data.Sections) == 0 {

Add a section to get started.

} for sIdx, section := range data.Sections {
if section.Name != "" {

{ section.Name }

} if len(section.Items) == 0 {

No items yet.

}
    for _, item := range section.Items {
  • { item.Name }
    if item.Note != "" {
    { item.Note }
    } if item.Allergens != "" {
    Allergens: { item.Allergens }
    }
    if item.Price != "" {
    { item.Price }
    }
  • }
}
} // menuSectionClass returns the CSS class for a section, leaving the first // section without a top margin and adding spacing between later sections. func menuSectionClass(idx int) string { if idx == 0 { return "mb-6" } return "mt-8 mb-6" }