import{aT as h,l as d,k as x,j as e,E as j,a9 as r}from"./app-BgLa5dit.js";import{M as m}from"./DwzYo0zp.chunk.js";function f({catalogName:t,itemId:n,region:l,closePopup:s}){const[a,o]=h.useState(!1),i=d(),c=x();async function u(){o(!0),c(m.deleteItem(t,n,l)).then(()=>i.success(`Successfully deleted catalog item: ${n}`)).catch(()=>i.error(`Failed to delete catalog item: ${n}. Please try again.`)).finally(s)}return e.jsx(j,{title:"Delete Item",closePopup:s,showLoadingSpinner:!t,children:!!t&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Are you sure you want to delete item ",e.jsx("strong",{children:n})," in ",e.jsx("strong",{children:t}),"?"]}),e.jsxs("p",{children:["This will ",e.jsx("strong",{children:"permanently"})," delete the catalog item and cannot be undone."]}),e.jsxs(r,{children:[e.jsx(r.Cancel,{onClick:s}),e.jsx(r.Submit,{showSpinner:a,onClick:u,variant:"danger",text:"Delete Item"})]})]})})}export{f as DeleteItemView};
//# sourceMappingURL=Cvm0bUg3.chunk.js.map
