import{k as m,l as h,R as x,o as y,p as c,j as e,E as j,a9 as a}from"./app-BgLa5dit.js";function P(t){var o,l;const i=m(),n=h(),[p,u]=x.useState(!1),s=y(c.getReportTemplate(t.id));async function d(){var r;u(!0);try{await i(c.deleteReportTemplate(t.id)),n.success(`Successfully deleted report template: ${(r=s.data)==null?void 0:r.name}.`)}catch{n.error("Failed to delete. Please try again.")}t.closePopup()}return e.jsx(j,{title:"Delete report template",closePopup:t.closePopup,showLoadingSpinner:!((o=s.data)!=null&&o.name),backdrop:"static",children:e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Are you sure you want to delete ",e.jsx("strong",{children:(l=s.data)==null?void 0:l.name})," from your saved reports?"]}),e.jsxs(a,{children:[e.jsx(a.Cancel,{onClick:t.closePopup}),e.jsx(a.Submit,{onClick:d,variant:"danger",text:"Delete",showSpinner:p})]})]})})}export{P as AssemblyLineDeleteReportTemplateView};
//# sourceMappingURL=MQfK7dQC.chunk.js.map
