Loading karaokatalog/ui/static/components/pieces/SongList.js 0 → 100644 +11 −0 Original line number Diff line number Diff line import Artist from "./Artist.js" import Pagination from "./Pagination.js" export default { view: function (vnode) { const sortedSongs = vnode.attrs.songs.toSorted((a, b) => a.artist.localeCompare(b.artist) || a.title.localeCompare(b.title)) const songsByArtist = Map.groupBy(sortedSongs, song => song.artist) return m(Pagination, { elements: songsByArtist.entries().map(([artist, songs]) => m(Artist, { artist, songs })) }) }, } Loading
karaokatalog/ui/static/components/pieces/SongList.js 0 → 100644 +11 −0 Original line number Diff line number Diff line import Artist from "./Artist.js" import Pagination from "./Pagination.js" export default { view: function (vnode) { const sortedSongs = vnode.attrs.songs.toSorted((a, b) => a.artist.localeCompare(b.artist) || a.title.localeCompare(b.title)) const songsByArtist = Map.groupBy(sortedSongs, song => song.artist) return m(Pagination, { elements: songsByArtist.entries().map(([artist, songs]) => m(Artist, { artist, songs })) }) }, }