import{R as C,o as p,e8 as D,k as N,b as E,a4 as b,j as r,h as e,dn as g,i as n,dp as S,aR as f,y as _,D as O}from"./app-BgLa5dit.js";import{u as v}from"./ekVIVtrT.chunk.js";import{D as h}from"./BE59vaMU.chunk.js";import{E as x}from"./D-bfnq46.chunk.js";import{D as y}from"./BYqcacqE.chunk.js";import"./KIVqng-q.chunk.js";import"./DdbSDhh9.chunk.js";import"./0GREfvNX.chunk.js";import"./JAv_fVmZ.chunk.js";import"./B5-QmNlz.chunk.js";import"./CTg_3F42.chunk.js";import"./DEF_vJGe.chunk.js";import"./CGQPfl0D.chunk.js";function W(o){const[i,m]=C.useState(!0),c=p(f.currentUser()),s=p(D.getContentPartner(o.id));function u(t){var a;return h.dashboards({targetType:O.PartnerProfile,slug:(a=s.data)==null?void 0:a._slug.value},i,t)}const d=N();function A(t){s.data&&d(u(t))}const l=v(u,A),{hasPermissions:P}=E(),R=P(b.CompanyDashboardStatusUpdate);function T(t){let a=h.updateDashboard(t.id,t);return t.status===_.Archived&&(a=D.archiveDashboard(t.id)),d(a)}return r.jsxs(r.Fragment,{children:[c.data&&r.jsx(x,{contentPartnerId:o.id,activeAction:e.ContentPartners.CONTENT_PARTNER_DASHBOARDS,currentUser:c.data}),s.data&&r.jsx(y,{canPublish:R,dashboards:l.items,onStatusChange:T,filterArchivedDashboards:i,setFilterArchivedDashboards:m,getEditDetailsAppLink:t=>({application:n.CONTENT_PARTNERS,action:e.ContentPartners.EDIT_DASHBOARD_DETAILS,args:[t]}),getDeleteAppLink:t=>({application:n.CONTENT_PARTNERS,action:e.ContentPartners.DELETE_DASHBOARD,args:[t]}),getNewDashboardAppLink:()=>({application:n.CONTENT_PARTNERS,action:e.ContentPartners.NEW_CONTENT_PARTNER_DASHBOARD,args:[o.id,s.data._slug.value]}),getCopyDashboardAppLink:t=>({application:n.CONTENT_PARTNERS,action:e.ContentPartners.COPY_DASHBOARD,args:[t]}),columns:g.getColumnSet(S.DiscoverDashboard)})]})}export{W as ContentPartnerDashboardsView};
//# sourceMappingURL=D890kNhG.chunk.js.map
