dotfiles/.config/spicetify/Extracted/Raw/xpui/xpui-routes-folder.js

2 lines
3.6 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([[9124],{88627:(e,r,s)=>{s.r(r),s.d(r,{default:()=>E});var i=s(59496),l=s(61740),a=s(89605),n=s(50346),t=s(3802),d=s(75523),o=s(91703),c=s(45911),x=s(23627),m=s(56162),f=s(47425),g=s(24952),u=s(96768),j=s(9374),p=s(4637);const h=({folder:e,index:r})=>{const s=e.items.filter((e=>e.type===j.p.PLAYLIST)).length,i=e.items.filter((e=>"folder"===e.type)).length;return(0,p.jsx)(g.C,{uri:e.uri,index:r,featureIdentifier:"folder",headerText:e.name,renderSubHeaderContent:()=>(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)(m.D,{variant:"mesto",children:[t.ag.get("web-player.folder.playlists",s),","," ",t.ag.get("web-player.folder.folders",i)]})}),renderCardImage:()=>(0,p.jsx)(u.x,{FallbackComponent:e=>(0,p.jsx)(f.P,{iconSize:64,...e})}),isPlayable:!1})};var y=s(63120);const P="folder-folderPage-sectionWrapper",b="rbLspqGazxdY3fuaxvkM",v="_odE2h85itP7mBz2_vUR",N="x49I_IPmWNCLnUJSw28O",U=({folderName:e,folderUri:r})=>(0,p.jsxs)("div",{className:v,children:[(0,p.jsx)(f.P,{className:N}),(0,p.jsx)(y.default,{to:r,children:(0,p.jsx)(m.D,{variant:"canon",children:e})})]});var k=s(62517),C=s(98340);const I=({folder:e,isFolder:r,isPlaylist:s})=>{const i=(e,i)=>r(e)?(0,p.jsx)(h,{folder:e,index:i}):s(e)?(0,p.jsx)(d.Z,{index:i,name:e.name,uri:e.uri,images:e.images,description:e.description,authorName:e.owner.displayName,isPlayable:e.totalLength>0}):null;return(0,p.jsxs)("div",{children:[(0,p.jsx)(U,{folderName:e.name,folderUri:e.uri}),(0,p.jsx)(k.T,{render:()=>e.items.map(((e,r)=>(0,p.jsx)(C.ZP,{value:"card",index:r,children:i(e,r)},e.uri)))})]})};var w=s(48607),L=s(67458),F=s(4270),M=s(77312);const S=({folderUri:e,hasPlaylists:r,onClick:s,playing:i,supportsFolderPlayback:l})=>(0,p.jsx)(F.o,{children:(0,p.jsx)(F.F,{children:l&&(0,p.jsx)(M.$,{onClick:s,isPlaying:i,size:"lg",disabled:!r,uri:e})})});var T=s(41226),Z=s(16743),_=s(73997);const z=({folderName:e,folderUri:r})=>(0,p.jsxs)(T.gF,{children:[(0,p.jsx)(Z.W,{children:(0,p.jsx)(_.i,{text:e,dragUri:r,dragLabel:e})}),(0,p.jsxs)(T.sP,{children:[(0,p.jsx)(m.D,{variant:"mestoBold",children:t.ag.get("folder.title")}),(0,p.jsx)(T.xd,{dragUri:r,dragLabel:e,children:e})]})]}),D=e=>{const{id:r}=e,s=(0,l.v9)((({session:e})=>e?.user?.id))||"",a=(0,n.ir)(s,r).toURI(),m=(0,L.C)({folderUri:a,decorateImagesAndOwner:!0}),f=(0,l.v9)((e=>e.platform.isDesktop)),{isPlaying:g,togglePlay:u}=(0,w.n)({uri:a},{featureIdentifier:"folder"}),h=e=>e.type===j.p.PLAYLIST,y=e=>"folder"===e.type,v=(0,i.useMemo)((()=>m?m.items.filter(h):[]),[m]),N=(0,i.useMemo)((()=>m?m.items.filter(y):[]),[m]),U=v.length>0||N.length>0;return m?(0,p.jsxs)("section",{className:P,children:[(0,p.jsx)(o.$,{children:t.ag.get("playlist.page-title",m.name)}),(0,p.jsx)(z,{folderName:m.name,folderUri:a}),(0,p.jsx)(S,{supportsFolderPlayback:f,onClick:()=>u(),playing:g,hasPlaylists:U,folderUri:a}),(0,p.jsx)("div",{className:"contentSpacing",children:U?(0,p.jsx)(C.ZP,{value:"EntitiesGrid",children:(0,p.jsxs)("div",{className:b,children:[(0,p.jsx)(k.T,{render:()=>v.map(((e,r)=>(0,p.jsx)(C.ZP,{value:"card",index:r,children:(0,p.jsx)(d.Z,{index:r,name:e.name,uri:e.uri,images:e.images,description:e.description,authorName:e.owner.displayName,isPlayable:e.totalLength>0})},e.uri)))}),N.map((e=>(0,p.jsx)(I,{folder:e,isPlaylist:h,isFolder:y},e.uri)))]})}):(0,p.jsx)(c.u,{title:t.ag.get("folder.empty.title"),message:t.ag.get("folder.empty.subtitle"),renderInline:!0})})]}):(0,p.jsx)(x.h,{hasError:!1,errorMessage:t.ag.get("error.generic")})},E=(0,i.memo)((function(){const{folderId:e=""}=(0,a.UO)();return(0,p.jsx)(D,{id:e},e)}))}}]);
//# sourceMappingURL=xpui-routes-folder.js.map