import{dk as d,l as c,o as p,S as h,j as e,E as l,G as u,H as D,y as m,I as b,a as g,D as y,g as A,h as S,i as f}from"./app-BgLa5dit.js";import{D as I,E as R}from"./LqVj63BJ.chunk.js";import{D as T}from"./BE59vaMU.chunk.js";import"./KIVqng-q.chunk.js";function C(a){const r=d(),s=c(),t=p(h.presentation(a.presentationId));function n(o){r(T.createDashboard({name:o.name,description:o.description,target:g.getDashboardTarget({targetType:y.Company,companyId:a.companyId,presentationId:a.presentationId}),learningLevel:t.data.learningLevel,userType:b.Any,status:m.Draft,contentRegion:D.GLOBAL},i=>{s.success("Successfully created the dashboard"),A.trigger({application:f.DASHBOARD_EDITOR,action:S.DashboardEditor.EDIT_DASHBOARD,args:[i.id]})},()=>{s.error("Something went wrong when creating the dashboard"),a.closePopup()}))}return e.jsx(l,{title:"Create new dashboard",closePopup:a.closePopup,children:t.data&&e.jsx(u,{initialValues:{name:"",description:""},validationSchema:I,onSubmit:n,children:e.jsx(R,{closePopup:a.closePopup,dashboardWidgets:[],isNew:!0})})})}export{C as NewCompanyDashboardView};
//# sourceMappingURL=D0gKbkl0.chunk.js.map
