package templates import ( "github.com/maid-zone/soundcloak/lib/sc" "net/url" "strconv" "strings" ) templ PlaylistHeader(p sc.Playlist) { } templ Playlist(p sc.Playlist) { if p.Artwork != "" { }

{ p.Title }

{ p.Author.Username }

if p.Author.FullName != "" { { p.Author.FullName } }
if p.Description != "" {
Toggle description

{ p.Description }

}

{ strconv.FormatInt(p.TrackCount, 10) } tracks



for _, track := range p.Tracks { if track.Title != "" { if track.Artwork != "" { } else { }

{ track.Title }

{ track.Author.Username }
} }
if len(p.MissingTracks) != 0 { more tracks }
if p.TagList != "" {

Tags: { strings.Join(sc.TagListParser(p.TagList), ", ") }

}

{ strconv.FormatInt(p.Likes, 10) } likes


Created: { p.CreatedAt }

Last modified: { p.LastModified }

} templ SearchPlaylists(p *sc.Paginated[*sc.Playlist]) { Found { strconv.FormatInt(p.Total, 10) } playlists

if len(p.Collection) == 0 { if p.Total != 0 {

no more results

} } else { for _, playlist := range p.Collection { if playlist.Artwork != "" { } else { }

{ playlist.Title }

{ playlist.Author.Username }
} } if p.Total != 0 && len(p.Collection) != 0 && p.Next != "" { more playlists } }