package main import "strconv" // tracklistComponent renders the track table. Rows wrap on small screens so // duration is never dropped (UAT 7.6). templ tracklistComponent(data TracklistData) {
tracklist
if len(data.Tracks) == 0 {

No tracks yet.

} else {
    for i, t := range data.Tracks {
  1. { strconv.Itoa(i + 1) } if t.URL != "" { { trackTitleOr(t.Title) } } else { { trackTitleOr(t.Title) } } { durationOrDash(t.Duration) }
  2. }
}
} func durationOrDash(s string) string { if s == "" { return "--:--" } return s }