1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7306],{97306:(t,e,a)=>{a.r(e),a.d(e,{ChangeParticipantStateModal:()=>l});var i=a(6029),n=a(55729),r=a(96723),d=a(89401),s=a(2083),p=a(3580);let c={Pending:[p.SfdpParticipantState.Approved,p.SfdpParticipantState.TestnetOnboarded,p.SfdpParticipantState.Rejected],TestnetOnboarded:[p.SfdpParticipantState.Approved,p.SfdpParticipantState.Rejected,p.SfdpParticipantState.Retired],Approved:[p.SfdpParticipantState.Rejected,p.SfdpParticipantState.Retired],Rejected:[p.SfdpParticipantState.Approved,p.SfdpParticipantState.TestnetOnboarded,p.SfdpParticipantState.Retired],Retired:[p.SfdpParticipantState.Approved]};function l({show:t,validatorData:e,handleClose:a,handleSubmit:S}){let o,[u,f]=(0,n.useState)(""),[h,P]=(0,n.useState)(""),[g,j]=(0,n.useState)(""),[v,x]=(0,n.useState)(!1);async function m(){if(!u)return j("Select a status!");if("Rejected"===u&&!h)return j("Must set a note when rejecting a participant!");j(""),x(!0);try{let t=await (0,r.A)("/admin/validators/update-status",{method:"POST",body:{ids:[e.id],state:u,note:h},withCredentials:!0});t?.status==="success"&&S(u)}catch(e){let t=e?.responseData||{};j(t?.message||e?.message||"Something went wrong!"),console.error("Error updating participant status:",e)}x(!1)}return(0,n.useEffect)(()=>{f(""),P(""),j("")},[e]),o=e?.state===p.SfdpParticipantState.Pending&&"NO_KYC"===e.kycStatus?[p.SfdpParticipantState.Rejected]:c[e?.state],(0,i.jsx)(d.A,{show:t,close:a,children:(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",padding:"1rem",gap:"1rem"},children:[(0,i.jsx)("h3",{children:"Update Validator Status"}),g&&(0,i.jsx)("div",{className:"text-danger",role:"alert",children:g}),(0,i.jsxs)("select",{onChange:t=>{f(t.target.value),j("")},value:u,children:[(0,i.jsx)("option",{value:"",children:"Select Status"}),o?.map(t=>(0,i.jsx)("option",{value:t,children:t},t))]}),(0,i.jsx)("input",{onChange:t=>{P(t.target.value),j("")},value:h,type:"text",placeholder:"Note"}),v?(0,i.jsx)(s.A,{}):(0,i.jsx)("button",{className:"submit-button",type:"button",style:{alignSelf:"flex-end"},onClick:()=>m(),children:"Submit"})]})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.