(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12430,e=>{"use strict";var t=e.i(43476),s=e.i(48148),a=e.i(71645);e.s(["AdminReservationsTable",0,function(){let e=(0,s.useTranslations)("admin"),[n,d]=(0,a.useState)([]),[i,r]=(0,a.useState)(!0);async function c(){let e=await fetch("/api/admin/reservations");e.ok&&d(await e.json())}async function l(e,t){(await fetch("/api/admin/reservations",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,status:t})})).ok&&await c()}return((0,a.useEffect)(()=>{(async()=>{await c(),r(!1)})()},[]),i)?(0,t.jsx)("p",{className:"text-muted",children:"…"}):0===n.length?(0,t.jsx)("p",{className:"text-muted",children:e("noReservations")}):(0,t.jsx)("div",{className:"overflow-x-auto rounded-xl border border-border",children:(0,t.jsxs)("table",{className:"w-full min-w-[640px] text-left text-sm",children:[(0,t.jsx)("thead",{className:"border-b border-border bg-card/50 text-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"p-3 font-medium",children:e("status")}),(0,t.jsx)("th",{className:"p-3 font-medium",children:e("guest")}),(0,t.jsx)("th",{className:"p-3 font-medium",children:e("when")}),(0,t.jsx)("th",{className:"p-3 font-medium",children:"Email"}),(0,t.jsx)("th",{className:"p-3 font-medium",children:e("actions")})]})}),(0,t.jsx)("tbody",{children:n.map(s=>(0,t.jsxs)("tr",{className:"border-b border-border/80",children:[(0,t.jsx)("td",{className:"p-3 capitalize text-gold",children:s.status}),(0,t.jsxs)("td",{className:"p-3",children:[s.name,(0,t.jsxs)("span",{className:"text-muted",children:[" · ",s.partySize]})]}),(0,t.jsxs)("td",{className:"p-3 text-muted",children:[function(e){try{return new Date(e).toLocaleString()}catch{return e}}(s.date.toString())," ",s.time]}),(0,t.jsx)("td",{className:"p-3 text-muted",children:s.email}),(0,t.jsx)("td",{className:"p-3",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:["pending","confirmed","cancelled"].map(a=>(0,t.jsx)("button",{type:"button",onClick:()=>l(s.id,a),className:`rounded px-2 py-1 text-xs ${s.status===a?"bg-gold text-background":"bg-background text-muted hover:text-gold"}`,children:e(a)},a))})})]},s.id))})]})})}])}]);