import{b as u,j as t,i as h,n}from"./index-7c7a558c.js";import{m as g}from"./studentApi-6e4fac08.js";function x({refetchFn:m}){const{isLoading:s,mutate:c}=u(g,{onSuccess:e=>{var a;(a=e==null?void 0:e.data)!=null&&a.success&&n.success("Successful! You can now withdrawal your amount!"),m()},onError:e=>{var a,o,i,r;(o=(a=e==null?void 0:e.response)==null?void 0:a.data)!=null&&o.error?n.error((r=(i=e==null?void 0:e.response)==null?void 0:i.data)==null?void 0:r.error):n.error("something went wrong. Please try again")}});function d(){const e=new Date().getTime(),a=Math.random().toString(36).substr(2,10);return`${e}_${a}`}const l=e=>{e.preventDefault(),s||(n.dismiss(),c({formdata:{_token:d(),permission:"allowed"}}))};return t.jsx("div",{children:t.jsx("div",{className:"",children:t.jsxs("h4",{className:"flex gap-2 items-center",children:[t.jsx("span",{children:"Permit to cut 500/- from your balance: "}),t.jsx("button",{className:"flex gap-2 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 hover:from-indigo-500 hover:from-10% hover:via-sky-500 hover:via-30% hover:to-emerald-500 hover:to-90% hover:bg-gradient-to-l text-white p-2 rounded-lg px-6 my-6",onClick:l,children:s?t.jsx(h,{color:"dark",size:"lg",variant:"dots"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"Allow"}),t.jsx("span",{})]})})]})})})}export{x as A};
