module.exports=[37787,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944);a.s(["default",0,function({eventId:a,featured:e,status:f}){let g=(0,d.useRouter)(),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(null);async function l(b,c){if(c&&!confirm(c))return;k(null),i(!0);let d=await fetch("/api/admin/events",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventId:a,...b})}),e=await d.json().catch(()=>({}));(i(!1),d.ok)?g.refresh():k(e.error||"Action failed")}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:[(0,b.jsx)("button",{type:"button",onClick:()=>l({featured:!e}),disabled:h,className:`be-act ${e?"be-act-primary":"be-act-ghost"}`,children:e?"★ Featured":"Feature"}),"published"===f?(0,b.jsx)("button",{type:"button",onClick:()=>l({status:"draft"},"Take this event down? It will be removed from the public site."),disabled:h,className:"be-act be-act-danger",children:"Take down"}):(0,b.jsx)("button",{type:"button",onClick:()=>l({status:"published"}),disabled:h,className:"be-act be-act-ok",children:"Publish"})]}),j&&(0,b.jsx)("span",{className:"text-xs text-[color:var(--pill-danger-fg)]",children:j})]})}])}];

//# sourceMappingURL=src_app_admin_events_event-admin-actions_tsx_214wi5e._.js.map