dotfiles/.config/spicetify/Extracted/Raw/xpui/collection-music-download.js

2 lines
2.0 KiB
JavaScript
Raw Normal View History

2024-07-11 00:01:49 +05:30
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[4246],{99653:(e,a,r)=>{r.d(a,{z:()=>m});var s=r(28604),i=r(79823),n=r(79351),t=r(75523),u=r(58089),c=r(9374),o=r(12741),l=r(4637);function m(e,a){switch(e.type){case c.p.ALBUM:return(0,l.jsx)(s.r,{uri:e.uri,name:e.name,images:e.images,sharingInfo:null,artists:e.artists,index:a},e.uri);case c.p.ARTIST:return(0,l.jsx)(i.I,{uri:e.uri,name:e.name,images:e.images,index:a},e.uri);case c.p.SHOW:return(0,l.jsx)(u._,{uri:e.uri,name:e.name,images:e.images,publisher:e.publisher,sharingInfo:null,mediaType:o.E.UNKNOWN,index:a},e.uri);case c.p.AUDIOBOOK:return(0,l.jsx)(n.c,{uri:e.uri,name:e.name,images:e.images,authorName:e.authorName,index:a},e.uri);case c.p.PLAYLIST:return(0,l.jsx)(t.Z,{uri:e.uri,name:e.name,images:e.images,description:"",authorName:e.creatorName,index:a},e.uri);default:return null}}},22908:(e,a,r)=>{r.r(a),r.d(a,{LibraryMusicDownloads:()=>g,default:()=>h});var s=r(59496),i=r(56162),n=r(3802),t=r(99653),u=r(23627),c=r(62517),o=r(98340),l=r(98147),m=r(33046),d=r(4637);const g=(0,s.memo)((function(){const{isLoading:e,hasError:a,items:r}=(0,l.G)();return e||a?(0,d.jsx)(u.h,{hasError:a,errorMessage:n.ag.get("error.request-collection-music-downloads-failure")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.D,{as:"h1",variant:"canon",className:m.Z.header,children:n.ag.get("music_downloads")}),(0,d.jsx)(o.ZP,{value:"EntitiesGrid",children:(0,d.jsx)(c.T,{render:()=>r.map(((e,a)=>(0,d.jsx)(o.ZP,{value:"card",index:a,children:(0,t.z)(e,a)},e.uri)))})})]})})),h=g},98147:(e,a,r)=>{r.d(a,{G:()=>n});var s=r(59496),i=r(49873);function n(){const e=(0,i.c)(),[a,r]=(0,s.useState)(!0),[n,t]=(0,s.useState)(!1),[u,c]=(0,s.useState)([]);return(0,s.useEffect)((()=>{(async()=>{try{const a=await e.getDownloads();c(a)}catch(e){t(!0)}finally{r(!1)}})()}),[e]),{isLoading:a,hasError:n,items:u}}}}]);
//# sourceMappingURL=collection-music-download.js.map