import{dk as E,dn as I,dp as k,e7 as m,h as N,i as D,j as e,e9 as w,av as F,at as L,bk as O,e8 as R}from"./app-BgLa5dit.js";import{S as A}from"./nO4MXtNL.chunk.js";import{u as H}from"./8Im-OACs.chunk.js";import{O as T}from"./B-fq6xxv.chunk.js";import{M as B}from"./CJkmdwb7.chunk.js";import{u as Q,a as q,C as G}from"./BgxNwnDA.chunk.js";import{E as U}from"./D-bfnq46.chunk.js";import"./HrByhRZi.chunk.js";import"./g56uS58q.chunk.js";import"./CTg_3F42.chunk.js";import"./DdbSDhh9.chunk.js";import"./BSa28HTr.chunk.js";import"./EZim8aq-.chunk.js";function ae(r){const u=E(),{data:s,appLinks:n}=Q({id:r.id}),{currentUser:i,contentPartner:p}=s,{data:S,searchQuery:h,setSearchQuery:f,isFetching:o,isSearching:a}=q({partnerProfileId:r.id,type:"series"});function c(t){return R.partnerProfileObjects({id:r.id,type:"series",cursor:t})}function d(t){a||u(c(t))}const{items:x,hasFirstPageCompleted:b,isFetching:g,hasMore:j,nextCursor:P}=H(c,d),l=a&&!o?S:x,C=a?!1:j,v=I.getColumnSet(k.ContentPartnerSeries),y={actions:t=>[{label:"Delete",button:!0,svg:F,appLink:n.deleteContentPartnerSeries(r.id,t.id),className:"btn btn-outline-danger"}],appLinks:{[m.Series]:t=>({application:D.SERIES,action:N.Series.EDIT_SERIES,args:[t.id]})},extraData:{}},M=b&&s.loaded;return e.jsxs(e.Fragment,{children:[!!i.data&&e.jsx(U,{contentPartnerId:r.id,activeAction:n.viewSeries(r.id).action,currentUser:i.data}),(()=>{var t;return M?e.jsxs("div",{className:"tw-relative",children:[o&&e.jsx(G,{}),e.jsx(T,{object:{name:`${(t=p.data)==null?void 0:t.name} Series`}}),e.jsx(B,{members:l,columnGroups:[m.Series],columns:v,columnData:y,emptyStateText:"No series found.",isFetching:g,fetchNext:d,nextCursor:P,hasMoreMembers:C,classNames:{filterContainer:"flex-wrap gap-2 justify-content-between"},onlyHideTableOnEmpty:!0,children:e.jsxs("div",{className:"mx-1 d-flex flex-row gap-3",children:[e.jsx(A,{name:"content-partner-series-search",placeholder:"Search series",setQuery:f,query:h,disabled:a?!1:!l.length}),e.jsx(L,{svg:O,className:"btn btn-outline-dark",appLink:n.addSeries(r.id),children:"Add Series"})]})})]}):e.jsx(w,{})})()]})}export{ae as ContentPartnerSeriesView};
//# sourceMappingURL=BR52DFp9.chunk.js.map
