import{k,l as f,R as h,o as m,p as r,f as g,j as e,E as x,a9 as i,g as F,aS as j}from"./app-BgLa5dit.js";function q(t){var a;const l=k(),n=f(),[o,u]=h.useState(!1),s=(a=m(r.getQuickFilters(t.stage)).data)==null?void 0:a.find(p=>p.id===t.id),{appLink:c}=g.getCurrentRoute();function d(){u(!0),l(r.deleteQuickFilter(t.id,t.stage)).then(()=>{n.success(`Successfully deleted quick filter: ${s.name}.`),F.trigger({...c,params:{...j.pick(c.params,["query","sort"])}})}).catch(()=>n.error(`Failed to delete quick filter: ${s.name}. Please try again.`)).finally(t.closePopup)}return e.jsx(x,{title:"Delete view",closePopup:t.closePopup,showLoadingSpinner:!s,backdrop:"static",children:!!s&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Are you sure you want to delete ",e.jsx("strong",{children:s.name})," from your Quick Filters?"]}),e.jsxs(i,{children:[e.jsx(i.Cancel,{onClick:t.closePopup}),e.jsx(i.Submit,{onClick:d,variant:"danger",text:"Delete view",showSpinner:o})]})]})})}export{q as DeleteQuickFilterView};
//# sourceMappingURL=PWWFX6Ki.chunk.js.map
