import{k as f,l as j,o as d,R as v,j as e,E as R,a8 as w,a9 as t}from"./app-BgLa5dit.js";import{O as i}from"./u6fIQ8Ti.chunk.js";function I(s){var l,p,r;const m=f(),o=j(),n=d(i.organisation(s.id)),c=d(i.getIdpMappings(s.id)),u=(l=c.data)==null?void 0:l.find(a=>a.idpId===s.idpId),[h,g]=v.useState(!1);function x(){if(!u)return;const a=i.removeIdpMappings(s.id,s.idpId);g(!0),m(a).then(()=>o.success("Successfully removed the organisation's sso mapping")).catch(()=>o.error("Something went wrong")).finally(s.closePopup)}const S=n.hasCompleted&&c.hasCompleted;return e.jsxs(R,{title:"Remove SSO mapping",closePopup:s.closePopup,showLoadingSpinner:!S,children:[e.jsx("p",{children:"Are you sure you want to remove this mapping?"}),e.jsxs("ul",{className:"mt-1 ps-3 ms-1",children:[e.jsxs("li",{children:["SSO: ",e.jsx("span",{className:"font-label",children:w.toTitleCase(s.idpId)})]}),e.jsxs("li",{children:["Customer: ",e.jsx("span",{className:"font-label",children:`${(p=n.data)==null?void 0:p.name} (${(r=n.data)==null?void 0:r.id})`})]})]}),e.jsxs(t,{children:[e.jsx(t.Cancel,{onClick:s.closePopup}),e.jsx(t.Submit,{text:"Remove SSO mapping",variant:"danger",onClick:x,showSpinner:h})]})]})}export{I as RemoveOrganisationSsoMappingView};
//# sourceMappingURL=BAlPPoxy.chunk.js.map
