owntone-server/htdocs/assets/ListPlaylists.js
2023-12-14 20:00:28 +00:00

2 lines
1.5 KiB
JavaScript

import{M as u}from"./ModalDialogPlaylist.js";import{_ as f,r as d,o,c as a,F as m,f as y,a as t,d as n,t as g,h as k,g as v,B as C}from"./index.js";const w={name:"ListPlaylists",components:{ModalDialogPlaylist:u},props:["playlists"],data(){return{show_details_modal:!1,selected_playlist:{}}},methods:{open_playlist(e){e.type==="folder"?this.$router.push({name:"playlist-folder",params:{id:e.id}}):this.$router.push({name:"playlist",params:{id:e.id}})},open_dialog(e){this.selected_playlist=e,this.show_details_modal=!0},icon_name(e){return e.type==="folder"?"folder":e.type==="rss"?"rss":"music-box-multiple"}}},x=["onClick"],B={class:"media-left is-clickable"},L={class:"media-content is-clickable is-clipped"},b=["textContent"],M={class:"media-right"},P=["onClick"];function z(e,r,_,D,i,l){const c=d("mdicon"),p=d("modal-dialog-playlist");return o(),a(m,null,[(o(!0),a(m,null,y(_.playlists,s=>(o(),a("div",{key:s.itemId,class:"media is-align-items-center",onClick:h=>l.open_playlist(s.item)},[t("figure",B,[n(c,{class:"icon",name:l.icon_name(s.item),size:"16"},null,8,["name"])]),t("div",L,[t("h1",{class:"title is-6",textContent:g(s.item.name)},null,8,b)]),t("div",M,[t("a",{onClick:k(h=>l.open_dialog(s.item),["prevent","stop"])},[n(c,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,P)])],8,x))),128)),(o(),v(C,{to:"#app"},[n(p,{show:i.show_details_modal,playlist:i.selected_playlist,onClose:r[0]||(r[0]=s=>i.show_details_modal=!1)},null,8,["show","playlist"])]))],64)}const V=f(w,[["render",z]]);export{V as L};