import{R as x,k as y,o as p,S,b as g,a4 as I,j as s,ar as E,h as n,i as o,dn as f,dp as N,aR as P,D as R}from"./app-BgLa5dit.js";import{u as j}from"./ekVIVtrT.chunk.js";import{D as m}from"./BE59vaMU.chunk.js";import{g as O,E as v}from"./CZm-cuK3.chunk.js";import{D as M}from"./BYqcacqE.chunk.js";import"./KIVqng-q.chunk.js";import"./BfMtaC_g.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(t){const[i,h]=x.useState(!0),r=y(),c=p(P.currentUser()),u=O(t.context);function d(a){return m.dashboards({targetType:R.Company,companyId:t.companyId,presentationId:t.presentationId},i,a)}function D(a){r(d(a))}const A=j(d,D),e=p(S.presentation(t.presentationId)),{hasPermissions:l}=g();function b(a){return r(m.updateDashboard(a.id,a))}const C=l(I.CompanyDashboardStatusUpdate);return e.data?s.jsxs(s.Fragment,{children:[!!c.data&&s.jsx(v,{companyId:t.companyId,activeAction:u.editDashboards(t.companyId).action,currentUser:c.data,context:t.context}),s.jsxs("div",{className:"mt-3",children:[s.jsx("h6",{children:`Presentation: ${e.data.name}`}),s.jsx("p",{children:e.data.description})]}),s.jsx(M,{presentation:e.data,dashboards:A.items,onStatusChange:b,canPublish:C,columns:f.getColumnSet(N.DiscoverDashboard),filterArchivedDashboards:i,setFilterArchivedDashboards:h,getEditDetailsAppLink:a=>({application:o.COMPANIES,action:n.Companies.EDIT_COMPANY_DASHBOARD_DETAILS,args:[a]}),getDeleteAppLink:a=>({application:o.COMPANIES,action:n.Companies.DELETE_DASHBOARD,args:[a]}),getNewDashboardAppLink:()=>({application:o.COMPANIES,action:n.Companies.NEW_COMPANY_DASHBOARD,args:[t.companyId,t.presentationId]}),getCopyDashboardAppLink:a=>({application:o.MOVIES_AND_TV,action:n.MoviesAndTv.COPY_DASHBOARD,args:[a]})})]}):s.jsx("div",{className:"text-center py-3",children:s.jsx(E,{as:"div",animation:"border",role:"status"})})}export{W as EditCompanyDashboardsView};
//# sourceMappingURL=7eSMWLHw.chunk.js.map
