import{k as j,l as f,aT as g,o as l,j as e,E as C,cY as k,dj as b,a9 as m}from"./app-BgLa5dit.js";import{S as d}from"./B11DWb8Z.chunk.js";import{C as w}from"./q-IBKcuF.chunk.js";import"./CIRO_mWB.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 V(s){var o,c;const p=j(),u=f(),[n,i]=g.useState(!1),a=l(w.customer(s.id)),r=l(d.getRmUnifyLicence(s.id)),t=(o=r.data)==null?void 0:o.licenceKey;async function h(){i(!0);try{await p(d.generateRmUnifyLicence(s.id))}catch{u.error("Something went wrong, please try again")}finally{i(!1)}}const x=!a.hasCompleted||!r.hasCompleted,y=t?"Find the":"Create a";return e.jsx(C,{size:"lg",title:"Generate license key",closePopup:s.closePopup,showLoadingSpinner:x,children:e.jsxs("div",{children:[e.jsxs("p",{className:"mb-2",children:[y," license key for ",e.jsx("strong",{children:(c=a.data)==null?void 0:c.name})]}),e.jsxs("div",{className:"d-flex py-2 align-items-center mb-2",children:[e.jsx("span",{className:"fw-semibold flex-shrink-0 me-3",children:"License key"}),t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"me-2",children:t}),e.jsx(k,{copyableContent:t,visible:!0})]}):e.jsxs("div",{className:"d-flex gap-2 align-items-center w-100 justify-content-between",children:[e.jsx("p",{className:"mb-0",children:`This customer doesn't have a license key, please click "Generate"`}),e.jsx(b,{variant:"dark",onClick:h,disabled:n,showSpinner:n,children:"Generate"})]})]}),e.jsx(m,{children:e.jsx(m.Submit,{variant:"outline-dark",text:"Close",onClick:s.closePopup})})]})})}export{V as CustomerSsoWizardGenerateLicenseKeyView};
//# sourceMappingURL=B4O3Ek8N.chunk.js.map
