module.exports=[33606,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944);function e({children:a,onClick:c,disabled:d,tone:f}){return(0,b.jsx)("button",{type:"button",onClick:c,disabled:d,className:`be-act be-act-${f}`,children:a})}a.s(["default",0,function({organizerId:a,status:f,hasPayoutAccount:g,payoutVerified:h}){let i=(0,d.useRouter)(),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null);async function n(a,b,c){if(c&&!confirm(c))return;m(null),k(!0);let d=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),e=await d.json().catch(()=>({}));(k(!1),d.ok)?i.refresh():m(e.error||"Action failed")}let o=(b,c)=>n("/api/admin/organizers/status",{organizerId:a,status:b},c),p=b=>n("/api/admin/payout-accounts/verify",{organizerId:a,verified:b});return(0,b.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-1.5",children:[g&&(h?(0,b.jsx)(e,{onClick:()=>p(!1),disabled:j,tone:"ghost",children:"Unverify"}):(0,b.jsx)(e,{onClick:()=>p(!0),disabled:j,tone:"primary",children:"Verify payout"})),"active"!==f&&(0,b.jsx)(e,{onClick:()=>o("active"),disabled:j,tone:"ghost",children:"Reactivate"}),"active"===f&&(0,b.jsx)(e,{onClick:()=>o("suspended","Suspend this organizer? They can't edit or publish events while suspended."),disabled:j,tone:"warn",children:"Suspend"}),"banned"!==f&&(0,b.jsx)(e,{onClick:()=>o("banned","Ban this organizer? Their published events are hidden from the public site."),disabled:j,tone:"danger",children:"Ban"})]}),l&&(0,b.jsx)("span",{className:"text-xs text-[color:var(--pill-danger-fg)]",children:l})]})}])}];

//# sourceMappingURL=src_app_admin_organizers_organizer-actions_tsx_12_6pd_._.js.map