Add Song class
This commit is contained in:
parent
0373572eb7
commit
a611362ad8
25
karaokatalog/ui/static/components/pieces/Song.js
Normal file
25
karaokatalog/ui/static/components/pieces/Song.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
export default {
|
||||||
|
view: function (vnode) {
|
||||||
|
const { song } = vnode.attrs
|
||||||
|
|
||||||
|
return m("article.song", [
|
||||||
|
m(".info", [
|
||||||
|
m(".title", song.title),
|
||||||
|
m(".artist", song.artist),
|
||||||
|
]),
|
||||||
|
m(".actions", [
|
||||||
|
m(
|
||||||
|
"span.material-symbols-outlined.heart-icon",
|
||||||
|
{
|
||||||
|
class: song.favorite ? "is-favorite" : "",
|
||||||
|
onclick: () => song.toggleFavorite(),
|
||||||
|
title: song.favorite
|
||||||
|
? "Als Favorit entfernen"
|
||||||
|
: "Als Favorit markieren",
|
||||||
|
},
|
||||||
|
"favorite",
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user