module.exports=[69052,a=>{"use strict";var b=a.i(87924),c=a.i(15925),d=a.i(72131);a.s(["ReserveForm",0,function(){let a=(0,c.useTranslations)("reserve"),[e,f]=(0,d.useState)("idle"),[g,h]=(0,d.useState)(!1);async function i(a){a.preventDefault(),h(!0),f("idle");let b=a.currentTarget,c=new FormData(b),d=String(c.get("date")),e={name:String(c.get("name")),email:String(c.get("email")),phone:String(c.get("phone")),partySize:Number(c.get("partySize")),date:new Date(`${d}T12:00:00`).toISOString(),time:String(c.get("time")),message:c.get("message")?String(c.get("message")):void 0};try{if(!(await fetch("/api/reservations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw Error("fail");f("ok"),b.reset()}catch{f("err")}finally{h(!1)}}return(0,b.jsxs)("form",{onSubmit:i,className:"mx-auto mt-8 grid max-w-lg gap-4 rounded-xl border border-border bg-card/60 p-6 shadow-[0_0_40px_rgba(201,162,39,0.06)] backdrop-blur",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("name")}),(0,b.jsx)("input",{required:!0,name:"name",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("email")}),(0,b.jsx)("input",{required:!0,type:"email",name:"email",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("phone")}),(0,b.jsx)("input",{required:!0,name:"phone",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("partySize")}),(0,b.jsx)("input",{required:!0,type:"number",min:1,max:50,name:"partySize",defaultValue:2,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("date")}),(0,b.jsx)("input",{required:!0,type:"date",name:"date",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("time")}),(0,b.jsx)("input",{required:!0,type:"time",name:"time",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("message")}),(0,b.jsx)("textarea",{name:"message",rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),"ok"===e&&(0,b.jsx)("p",{className:"text-sm text-gold",role:"status",children:a("success")}),"err"===e&&(0,b.jsx)("p",{className:"text-sm text-red-400",role:"alert",children:a("error")}),(0,b.jsx)("button",{type:"submit",disabled:g,className:"rounded-md bg-gold px-4 py-3 text-sm font-medium text-background transition hover:bg-gold-hover disabled:opacity-60",children:g?"…":a("submit")})]})}])}];

//# sourceMappingURL=src_components_ReserveForm_tsx_0y0-_jw._.js.map