import{dk as B,d as D,dn as A,dp as N,e7 as i,h,i as x,j as e,e9 as O,av as T,at as w,bk as L,g as F,e8 as H}from"./app-BgLa5dit.js";import{B as R}from"./Da6gN2lx.chunk.js";import{S as Q}from"./nO4MXtNL.chunk.js";import{u as q}from"./8Im-OACs.chunk.js";import{O as G}from"./B-fq6xxv.chunk.js";import{M as U}from"./CJkmdwb7.chunk.js";import{u as _,a as $,C as z}from"./BgxNwnDA.chunk.js";import{E as J}from"./D-bfnq46.chunk.js";import"./DusGkY45.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 le(n){const g=B(),{data:d,appLinks:a}=_({id:n.id}),{currentUser:l,contentPartner:f}=d,{data:S,searchQuery:C,setSearchQuery:b,isFetching:m,isSearching:s}=$({partnerProfileId:n.id,type:"videos"});function u(t){return H.partnerProfileObjects({id:n.id,type:"videos",cursor:t})}function p(t){s||g(u(t))}const{items:o,hasFirstPageCompleted:j,isFetching:k,hasMore:v,nextCursor:P}=q(u,p),c=s&&!m?S:o,V=s?!1:v,r=D(c||[]),y=A.getColumnSet(N.ContentPartnerVideos),E={actions:t=>[{label:"Delete",button:!0,appLink:a.deleteContentPartnerVideos(n.id,t.id),svg:T,className:"btn btn-outline-danger"}],appLinks:{[i.Video]:t=>({application:x.VIDEOS,action:h.Videos.EDIT_VIDEO,args:[t.id]}),[i.Series]:t=>({application:x.SERIES,action:h.Series.EDIT_SERIES,args:[t.id]})},extraData:{checkboxManager:r}};function I(){F.trigger(a.deleteContentPartnerVideos(n.id,r.getSelected()))}const M=j&&d.loaded;return e.jsxs(e.Fragment,{children:[!!l.data&&e.jsx(J,{contentPartnerId:n.id,activeAction:a.viewVideos(n.id).action,currentUser:l.data}),(()=>{var t;return M?e.jsxs("div",{className:"tw-relative",children:[m&&e.jsx(z,{}),e.jsx(G,{object:{name:`${(t=f.data)==null?void 0:t.name} Videos`}}),e.jsxs(U,{members:c,columnGroups:[i.Video,i.Series],columns:y,columnData:E,emptyStateText:"No videos found.",isFetching:k,fetchNext:p,nextCursor:P,hasMoreMembers:V,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(Q,{name:"content-partner-videos-search",query:C,setQuery:b,placeholder:"Search videos",disabled:s?!1:!c.length}),e.jsx(w,{svg:L,className:"btn btn-outline-dark",appLink:a.addVideos(n.id),children:"Add Video(s)"})]}),e.jsx("div",{className:"mx-1 w-100",children:e.jsx(R,{selectedCount:r.getSelectedCount(),onClickDeselectAll:r.deselectAll,onClickSelectBulk:I,getTypeText:()=>`of ${o.length} videos`,selectBulkActionButtonText:"Bulk remove videos",selectAllCount:o.length})})]})]}):e.jsx(O,{})})()]})}export{le as ContentPartnerVideosView};
//# sourceMappingURL=CBtVd_W8.chunk.js.map
