import{o as j,b as w,j as e,M as y,n as t}from"./index-7c7a558c.js";import{o as k}from"./ObjectToFormData-bf0af219.js";import{G as C}from"./Group-801c960a.js";function R({buttonText:n,buttonTexting:c,className:l,mutationFn:d,refetchFn:g,studentId:m,status:b}){const[f,{open:x,close:o}]=j(!1),{isLoading:p,mutate:h}=w(d,{onSuccess:()=>{o(),g(),t.dismiss(),t.success("Successfully status updated!")},onError:s=>{var a,i,u,r;t.dismiss(),(i=(a=s==null?void 0:s.response)==null?void 0:a.data)!=null&&i.error?t.error((r=(u=s==null?void 0:s.response)==null?void 0:u.data)==null?void 0:r.error):t.error("something went wrong. Please try again")}});return e.jsxs(e.Fragment,{children:[e.jsxs(y,{opened:f,onClose:o,title:"Confirmation",centered:!0,classNames:{content:"bg-gray-900 text-white",header:"bg-gray-900 text-white"},children:[e.jsx("p",{children:"Are you sure you want to reject this student?"}),e.jsxs("div",{className:"flex gap-4 my-4",children:[e.jsx("button",{type:"submit",className:"text-white bg-orange-700 hover:bg-orange-800 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:bg-orange-700 dark:hover:bg-orange-700 dark:focus:ring-blue-800",onClick:()=>h({formdata:k({student_id:m,status:b,rejected:1})}),children:p?c:n}),e.jsx("button",{type:"submit",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 w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",onClick:o,children:"Cancel"})]})]}),e.jsx(C,{position:"center",children:e.jsx("button",{onClick:x,className:l,children:n})})]})}export{R};
