import{R as n,k as b,l as p,j as e,E as f,a9 as t}from"./app-BgLa5dit.js";import{C as x}from"./Cgoejc6d.chunk.js";import{D}from"./BrZRQuEY.chunk.js";import{D as g}from"./BE59vaMU.chunk.js";import{u as j}from"./kHNgJL0M.chunk.js";import"./KIVqng-q.chunk.js";function v(a){const[r,l]=n.useState(!1),[d,h]=n.useState(!1),c=b(),o=p(),s=j(a.dashboardId);async function i(){l(!0);try{await c(g.deleteDashboard(a.dashboardId)),o.success("The dashboard has been successfully deleted")}catch{o.error("Something went wrong while removing the dashboard")}finally{a.closePopup()}}const u=!!s.data;return e.jsx(f,{title:"Delete Dashboard",closePopup:a.closePopup,children:u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{children:"Are you sure you want to delete:"}),e.jsx(D,{extraClassName:"mt-3",dashboard:s.data}),e.jsx(x,{challengePhrase:s.data.name,onChallengePass:m=>h(m)}),e.jsxs(t,{className:"mt-3",children:[e.jsx(t.Cancel,{onClick:a.closePopup}),e.jsx(t.Submit,{variant:"danger",onClick:i,text:"Delete",showSpinner:r,disabled:!d})]})]})})}export{v as RemoveStreamableDashboardView};
//# sourceMappingURL=CuNsqQzP.chunk.js.map
