1import{r as f,j as e}from"./index-If4P5t44.js";import{B as b}from"./button-CO1UM39t.js";import{I as a}from"./input-CHQSMs9m.js";import{L as t}from"./label-20_1edRh.js";import{T as g}from"./textarea-BB-jbRG_.js";import{u as v,C as N}from"./useContactSubmit-Bu_0i35f.js";import{L as k}from"./loader-circle-BUPsK-wL.js";import{o as y,s}from"./types-4og3oiYD.js";import"./utils-ClF6eiV5.js";import"./index-IwD7A4tH.js";import"./circle-check-CSiyQS0o.js";import"./client-BN_N-ZTx.js";import"./tslib.es6-Ds0fHAFP.js";import"./use-toast-BubhRJjm.js";const E=y({name:s().trim().min(1,"Navn er pÃ¥krævet").max(120),email:s().trim().email("Ugyldig e-mail").max(255),phone:s().trim().min(1,"Telefon er pÃ¥krævet").max(40),preferred_time:s().trim().min(1,"Tidspunkt er pÃ¥krævet").max(60),topic:s().trim().min(1,"Emne er pÃ¥krævet").max(500)});function V(){const{submit:l,submitting:d,submitted:c}=v("medarbejder"),[r,n]=f.useState({}),p=async o=>{o.preventDefault();const x=new FormData(o.currentTarget),u=Object.fromEntries(x.entries()),i=E.safeParse(u);if(!i.success){const h=i.error.flatten().fieldErrors;n(Object.fromEntries(Object.entries(h).map(([j,m])=>[j,(m==null?void 0:m[0])??""])));return}n({}),await l(i.data)};return e.jsx(N,{badge:"Ring mig op",title:"Tal med en medarbejder",subtitle:"Udfyld dine oplysninger â vi ringer dig op inden for én arbejdsdag.",submitted:c,children:e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"name",children:"Navn *"}),e.jsx(a,{id:"name",name:"name",required:!0,className:"mt-1.5"}),r.name&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:r.name})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"email",children:"E-mail *"}),e.jsx(a,{id:"email",name:"email",type:"email",required:!0,className:"mt-1.5"}),r.email&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:r.email})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"phone",children:"Telefon *"}),e.jsx(a,{id:"phone",name:"phone",type:"tel",required:!0,className:"mt-1.5"}),r.phone&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:r.phone})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"preferred_time",children:"Foretrukket opkaldstidspunkt *"}),e.jsxs("select",{id:"preferred_time",name:"preferred_time",required:!0,defaultValue:"",className:"mt-1.5 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"",disabled:!0,children:"Vælgâ¦"}),e.jsx("option",{value:"Formiddag (8-12)",children:"Formiddag (8-12)"}),e.jsx("option",{value:"Eftermiddag (12-16)",children:"Eftermiddag (12-16)"}),e.jsx("option",{value:"Sen eftermiddag (16-18)",children:"Sen eftermiddag (16-18)"}),e.jsx("option",{value:"NÃ¥r som helst",children:"NÃ¥r som helst"})]}),r.preferred_time&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:r.preferred_time})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"topic",children:"Hvad drejer det sig om? *"}),e.jsx(g,{id:"topic",name:"topic",rows:3,required:!0,className:"mt-1.5"}),r.topic&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:r.topic})]}),e.jsxs(b,{type:"submit",disabled:d,className:"w-full",size:"lg",children:[d&&e.jsx(k,{className:"h-4 w-4 animate-spin mr-2"}),"Bed om opkald"]})]})})}export{V as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.