import{l as g,k as m,o as A,R as x,j as e,E as R,a9 as n}from"./app-BgLa5dit.js";import{I as d}from"./Bm4DWMcW.chunk.js";function P(t){var o,c;const r=g(),l=m(),i=A(d.getIpAuthByCustomer(t.customerId)),s=(c=(o=i.data)==null?void 0:o.ipRanges)==null?void 0:c.find(a=>a.id===t.ipAuthRangeId),[u,h]=x.useState(!1);async function p(){var a;try{await l(d.deleteIpRange((a=i.data)==null?void 0:a.id,t.ipAuthRangeId)),r.success("Successfully removed the IP auth range."),t.closePopup()}catch{r.error("Failed to remove the IP auth range. Please try again.")}finally{h(!1)}}return s?e.jsxs(R,{size:"md",title:"Remove the IP auth range",closePopup:t.closePopup,children:[e.jsx("p",{children:"Are you sure to remove this IP auth range:"}),e.jsxs("p",{children:[e.jsxs("strong",{children:[s.startAddress," ",s.endAddress!==s.startAddress?`- ${s.endAddress}`:""]}),"?"]}),e.jsxs(n,{children:[e.jsx(n.Cancel,{text:"Cancel",onClick:t.closePopup}),e.jsx(n.Submit,{text:"Remove range",variant:"danger",showSpinner:u,disabled:u,onClick:p})]})]}):e.jsx(e.Fragment,{})}export{P as RemoveCustomerIpAuthRangeView};
//# sourceMappingURL=BnlaQIwe.chunk.js.map
