(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,49480,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(18566);e.s(["default",0,function({eventId:e,featured:i,status:l}){let n=(0,s.useRouter)(),[c,o]=(0,a.useState)(!1),[r,d]=(0,a.useState)(null);async function u(t,a){if(a&&!confirm(a))return;d(null),o(!0);let s=await fetch("/api/admin/events",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventId:e,...t})}),i=await s.json().catch(()=>({}));(o(!1),s.ok)?n.refresh():d(i.error||"Action failed")}return(0,t.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u({featured:!i}),disabled:c,className:`be-act ${i?"be-act-primary":"be-act-ghost"}`,children:i?"★ Featured":"Feature"}),"published"===l?(0,t.jsx)("button",{type:"button",onClick:()=>u({status:"draft"},"Take this event down? It will be removed from the public site."),disabled:c,className:"be-act be-act-danger",children:"Take down"}):(0,t.jsx)("button",{type:"button",onClick:()=>u({status:"published"}),disabled:c,className:"be-act be-act-ok",children:"Publish"})]}),r&&(0,t.jsx)("span",{className:"text-xs text-[color:var(--pill-danger-fg)]",children:r})]})}])}]);