package main import "mmaschedule-go/event" import "strconv" templ TemplEventPage(e event.Event, upcoming []event.ListUpcomingEventsRow) { MMA Schedule

{ e.Name }

@TemplIconCalendar("mr-2") @TemplTimestamp(e.Date)
if len(e.Location) > 0 {

@TemplIconLocation("mr-1") { e.Location }

}
for _, f := range e.UnmarshalFights() { @TemplFightRow(f) }
@TemplJSTimestamp() } templ TemplFightRow(f *event.Fight) {

{ f.Weight }

@TemplFighterCol(f.FighterA, false)

VS

@TemplFighterCol(f.FighterB, true)
} templ TemplFighterCol(f *event.Fighter, right bool) {
0 { target="_blank" href={ templ.URL(f.Link) } class="no-underline hover:underline" } >

{ f.Name }

if len(f.Country) > 0 {

{ f.Country }

}
} templ TemplTimestamp(timestamp int64) { //{{ date|date:'D M j, g:i A T' }} } templ TemplIconLocation(class string) { } templ TemplIconCalendar(class string) { } templ TemplJSTimestamp() { }