import{r as f,o as x,b as h,j as t,M as p,n as s}from"./index-7c7a558c.js";import{h as y}from"./adminCommonApi-0dc9ea8e.js";function k(){const[u,i]=f.useState(""),[c,{open:d,close:g}]=x(!1),{isLoading:r,mutate:m}=h(y,{onSuccess:e=>{var a,o;(a=e==null?void 0:e.data)!=null&&a.success&&s.success((o=e==null?void 0:e.data)==null?void 0:o.success)},onError:e=>{var a,o,l,n;(o=(a=e==null?void 0:e.response)==null?void 0:a.data)!=null&&o.error?s.error((n=(l=e==null?void 0:e.response)==null?void 0:l.data)==null?void 0:n.error):s.error("something went wrong. Please try again")}}),b=e=>{e.preventDefault(),s.dismiss(),r||m({formdata:{id_number:u}})};return t.jsxs(t.Fragment,{children:[t.jsx(p,{opened:c,onClose:g,title:"Change Senior Counsellor",centered:!0,classNames:{content:"bg-gray-900 text-white",header:"bg-gray-900 text-white"},children:t.jsxs("div",{className:"my-10",children:[t.jsxs("div",{className:"relative z-0 w-full mb-6 group",children:[t.jsx("input",{type:"number",name:"floating_counsellor_id",id:"floating_counsellor_id",className:"block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600",placeholder:"6546463",onChange:e=>i(e.target.value),required:!0}),t.jsx("label",{htmlFor:"floating_counsellor_id",className:"peer-focus:font-medium absolute text-sm text-gray-500 dark:text-gray-400 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6",children:"Senior Counsellor ID"})]}),t.jsx("div",{className:"flex gap-4 my-4",children:t.jsx("button",{className:"text-white bg-amber-500 hover:bg-amber-600 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:focus:ring-blue-800",onClick:e=>b(e),children:r?"Updating...":"Update"})})]})}),t.jsx("button",{onClick:d,className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Change Senior Counsellor"})]})}export{k as S};
