import{k as h,l as x,o as n,R as y,j as e,E as P,a9 as s}from"./app-BgLa5dit.js";import{A as m}from"./uachN0F4.chunk.js";import{C as f}from"./q-IBKcuF.chunk.js";import"./DUpYPoLs.chunk.js";import"./EZim8aq-.chunk.js";import"./BD9MrUJP.chunk.js";import"./s6cGcwlA.chunk.js";import"./Zwjmkasg.chunk.js";import"./4qGb1BIY.chunk.js";import"./DnXDEnAR.chunk.js";import"./DpUpv6rY.chunk.js";import"./CG7zbly5.chunk.js";import"./m4aqaK_l.chunk.js";import"./MEkA24R1.chunk.js";import"./C53kfXmd.chunk.js";function G(o){const a=h(),c=x(),t=n(f.customer(o.customerId)),r=n(m.customerAccessPolicy(o.customerId)),[l,u]=y.useState(!1);function p(){const d=m.removeCustomerAccessPolicy(o.customerId);u(!0),a(d).then(()=>c.success("Successfully removed the customer's pilot")).catch(()=>c.error("Something went wrong")).finally(o.closePopup)}const i=t.hasCompleted&&r.hasCompleted;return e.jsx(P,{title:"Remove access policy",closePopup:o.closePopup,showLoadingSpinner:!i,children:i&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Are you sure you want to remove the pilot: ",e.jsx("strong",{children:r.data.id}),"  from ",e.jsxs("strong",{children:[t.data.name," (",t.data.crmId,")"]}),"?"]}),e.jsxs(s,{children:[e.jsx(s.Cancel,{onClick:o.closePopup}),e.jsx(s.Submit,{text:"End pilot",variant:"danger",onClick:p,showSpinner:l})]})]})})}export{G as RemovePilotView};
//# sourceMappingURL=D6DE6K78.chunk.js.map
