artist-search-similar.templ (825B)
1 package artistsearchsimilar 2 3 import ( 4 "fmt" 5 "lyrics/internal/server/routes" 6 ) 7 8 templ ArtistSearchSimilar(params ArtistSearchSimilarParams) { 9 if len(params.Artists) >= 1 { 10 <p class="section-label -muted">Similar artists</p> 11 <ul> 12 for _, artist := range params.Artists { 13 {{ 14 value := artist.Name 15 16 if artist.LatinName != nil && artist.Disambiguation != nil { 17 value = fmt.Sprintf("%s (%s, %s)", artist.Name, *artist.LatinName, *artist.Disambiguation) 18 } else if artist.LatinName != nil { 19 value = fmt.Sprintf("%s (%s)", artist.Name, *artist.LatinName) 20 } else if artist.Disambiguation != nil { 21 value = fmt.Sprintf("%s (%s)", artist.Name, *artist.Disambiguation) 22 } 23 }} 24 <li title={ value }> 25 <a href={ routes.Artist(artist) }>{ value }</a> 26 </li> 27 } 28 </ul> 29 } 30 }