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

//# sourceMappingURL=0ukq_app_%5Blocale%5D_admin_%28protected%29_reservations_AdminReservationsTable_tsx_0g93z_u._.js.map