import{a as s,o as i}from"./chunk-NL6KNZEE-DfxmOBHd.js";function r(e){const[t,n]=s.useState(!1),a=()=>{if(e.confirm){if(!t){n(!0),setTimeout(()=>n(!1),3e3);return}n(!1)}e.onClick()};return i.jsxs("button",{onClick:a,disabled:e.loading||e.disabled,className:"relative px-5 py-2 rounded-md large-button flex disabled:opacity-50 items-center",children:[i.jsx("span",{className:e.loading?"invisible":"visible",children:t?"Are you sure?":e.children}),e.loading&&i.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:i.jsx("span",{className:"animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full"})})]})}export{r as A};
