import{o as w,aP as j,cB as P,aT as d,j as t,E as S,a9 as c,aQ as C,bY as J,bX as y,c0 as I,f1 as D,aR as N}from"./app-BgLa5dit.js";import{W as k}from"./6ciM85sA.chunk.js";import{J as m}from"./DfIMhO3y.chunk.js";import"./DkDkjje4.chunk.js";import"./vyqb6V0P.chunk.js";import"./DUpYPoLs.chunk.js";import"./DpUpv6rY.chunk.js";import"./CG7zbly5.chunk.js";import"./m4aqaK_l.chunk.js";import"./MEkA24R1.chunk.js";import"./C53kfXmd.chunk.js";function W(a){const o=w(N.currentUser()),r=j(),l=P(),[u,n]=d.useState(!1),[i,p]=d.useState("");function h(e,s){C(r,m.getJobProgress(i,e,s))}const b=()=>{switch(a.newStatus){case"verified":return"Proceeding will allow users to access the platform and the domain will be whitelisted.";case"denied":return"Proceeding will block users from accessing the platform and the domain will be blacklisted."}},f=e=>{p(e.id)},x=()=>{n(!1)},g=async()=>{var s;n(!0);const e={name:I.UpdateProspectDomains,type:y.UpdateProspectDomains,customerId:(s=o==null?void 0:o.data)==null?void 0:s.customerId,dataType:J.Unknown,metadata:{domainIds:[a.domainId],status:a.newStatus,description:"Manually updated prospect domain status"}};D(r,m.createJob(e)).then(f).catch(x)};return t.jsxs(S,{size:"md",title:"Change Domain Status",closePopup:a.closePopup,children:[t.jsxs("p",{children:["Are you sure you want to change the status of ",t.jsxs("span",{className:"fw-bold",children:['"',a.domainName,'"']})," from"," ",t.jsx("span",{className:a.currentStatus,children:a.currentStatus})," to"," ",t.jsx("span",{className:a.newStatus,children:a.newStatus}),"?"]}),t.jsx("p",{className:"mb-3",children:b()}),i?t.jsxs(t.Fragment,{children:[t.jsx("hr",{}),t.jsx(k,{jobId:i,pollJob:h,actionName:"Updating Domain",actionVerb:"Update",onStatusCompleted:()=>{n(!1),l(["domains:get","domains:search","domains:users"]),a.closePopup()}})]}):t.jsxs(c,{children:[t.jsx(c.Cancel,{onClick:a.closePopup}),t.jsx(c.Submit,{variant:"dark",text:"Confirm Change",showSpinner:u,onClick:()=>g()})]})]})}export{W as ChangeDomainStatusPopupView};
//# sourceMappingURL=6ycnqGAQ.chunk.js.map
