import{o as p,j as s,dv as u,h as r,i as h}from"./app-BgLa5dit.js";import{P as m}from"./CSDkhdb-.chunk.js";import{P as y}from"./DUyf8veO.chunk.js";const c=h.PLAYLISTS,P=a=>({application:c,action:r.Playlists.EDIT_PLAYLIST,args:[a.id]});function L(a,t){var e;return t!=null&&t.length?{...a,data:((e=a.data)==null?void 0:e.map(i=>({...i,metadata:t.find(n=>n.playlistId.toString()===i.id.toString())})))??[]}:a}function j(a){var n,o;const t=p(y.searchPlaylists(a.query,a.cursor)),e=p(!!((o=(n=t.data)==null?void 0:n.data)!=null&&o.length)&&y.metadataByIds(t.data.data.map(l=>l.id))),i=e.hasCompleted&&L(t.data,e.data);return s.jsxs(s.Fragment,{children:[s.jsx(m,{query:a.query}),!!t.data&&(t.data.data.length?s.jsx(u,{collection:i,columns:[{header:"Name",accessor:"name",appLink:P},{header:"Internal Description",accessor:l=>{var d;return(d=l.metadata)==null?void 0:d.internalDescription}}],collectionAppLink:{application:c,action:r.Playlists.SEARCH_PLAYLISTS,params:{query:a.query}},newObjectAppLink:{application:c,action:r.Playlists.NEW_PLAYLIST},objectName:"Playlist"}):s.jsx("p",{children:"No playlists found, please try a different search query."}))]})}export{j as PlaylistSearchResultsView};
//# sourceMappingURL=CfA0uaJl.chunk.js.map
