module.exports=[9529,a=>{"use strict";var b=a.i(87924);function c(...a){return a.filter(Boolean).join(" ")}a.i(38246);let d={primary:"bg-brand-green text-white hover:bg-brand-green-deep focus-visible:ring-brand-green",secondary:"border border-be-border bg-be-surface text-be-text hover:bg-be-surface-2 focus-visible:ring-brand-green",ghost:"text-be-muted hover:text-be-text hover:bg-be-surface-2 focus-visible:ring-brand-green",danger:"bg-[color:var(--pill-danger-fg)] text-white hover:opacity-90 focus-visible:ring-[color:var(--pill-danger-fg)]"};a.s(["Card",0,function({className:a,children:d}){return(0,b.jsx)("div",{className:c("be-card p-5",a),children:d})},"buttonClass",0,function(a="primary",b){return c("inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-be-bg disabled:opacity-50 disabled:pointer-events-none",d[a],b)}])},92263,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(95445),f=a.i(9529);function g({label:a,children:c}){return(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium mb-1 text-be-text",children:a}),c]})}a.s(["default",0,function(){let a=(0,d.useRouter)(),h=(0,e.createClient)(),[i,j]=(0,c.useState)({full_name:"",email:"",phone:""}),[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(!1);async function o(b){b.preventDefault(),n(!0),l(null);let{data:c}=await h.auth.getUser();if(!c.user){l("Not signed in"),n(!1);return}let{data:d,error:e}=await h.from("customers").insert({organizer_id:c.user.id,email:i.email.trim().toLowerCase(),full_name:i.full_name||null,phone:i.phone||null}).select().single();if(e){l("23505"===e.code?"You already have a customer with this email.":e.message),n(!1);return}a.push(`/dashboard/customers/${d.id}`)}return(0,b.jsxs)("form",{onSubmit:o,className:"space-y-4",children:[(0,b.jsx)(g,{label:"Full name",children:(0,b.jsx)("input",{value:i.full_name,onChange:a=>j({...i,full_name:a.target.value}),className:"input"})}),(0,b.jsx)(g,{label:"Email",children:(0,b.jsx)("input",{required:!0,type:"email",value:i.email,onChange:a=>j({...i,email:a.target.value}),className:"input"})}),(0,b.jsx)(g,{label:"Phone",children:(0,b.jsx)("input",{value:i.phone,onChange:a=>j({...i,phone:a.target.value}),className:"input"})}),k&&(0,b.jsx)("p",{className:"text-sm text-red-600",children:k}),(0,b.jsx)("button",{type:"submit",disabled:m,className:(0,f.buttonClass)("primary"),children:m?"Adding…":"Add customer"})]})}])}];

//# sourceMappingURL=src_0bb8wqn._.js.map