PageSourceSearch

https://inserate.ai/assets/Contact-CGudUd1r.js

js inserate.ai collected 2026-10-05 12:04:41 UTC 6,692 bytes, 5 lines download raw bytes

1import{s as M,j as e,e as E,l as u,L as D,a as $}from"./index-srEk6l1l.js";import{r as s}from"./react-vendor-6tfOnWTr.js";import{C as P}from"./check-circle-Do3MpRb3.js";import{A as T}from"./alert-circle-CaVMHHzT.js";import"./supabase-f3rawU88.js";const x=["Allgemeine Anfrage","Technischer Support","Konto & Anmeldung","Inserat melden","Presse & Medien","Partnerschaft","Sonstiges"],F=3e3,I=[/\bhttps?:\/\/\S+\.(ru|cn|tk|top|xyz|click)\b/i,/\b(viagra|cialis|casino|crypto investment|forex signals|seo backlinks|loan offer)\b/i,/\[url=/i,/<a\s+href=/i];function K({onNavigate:h}){const[a,p]=s.useState(""),[n,g]=s.useState(""),[d,b]=s.useState(x[0]),[i,f]=s.useState(""),[m,v]=s.useState(""),[o,r]=s.useState("idle"),[j,l]=s.useState(""),[N]=s.useState(()=>Date.now());s.useEffect(()=>{M({title:"Kontakt | inserate.ai",description:"Fragen, Feedback oder Support? Schreib uns — wir melden uns so schnell wie möglich. Allgemeine Anfragen, technischer Support und Pressekontakt.",url:"https://inserate.ai/kontakt"})},[]);const k=async t=>{if(t.preventDefault(),!a.trim()||!n.trim()||!i.trim())return;if(m.trim()!==""){r("success");return}if(Date.now()-N<F){l("Bitte nimm dir kurz Zeit für deine Nachricht und versuche es erneut."),r("error");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(n.trim())){l("Bitte gib eine gültige E-Mail-Adresse an."),r("error");return}const w=(i.match(/https?:\/\//gi)||[]).length,S=`${a} ${i}`;if(w>2||I.some(c=>c.test(S))){l("Deine Nachricht wurde als möglicher Spam erkannt. Bitte kontaktiere uns ohne Links oder Werbung."),r("error");return}try{const c=JSON.parse(localStorage.getItem("contact_last")||"null");if(c&&Date.now()-c<6e4){l("Du hast gerade erst eine Nachricht gesendet. Bitte warte einen Moment."),r("error");return}}catch{}r("sending"),l("");const y=`[Kontakt] ${d} – ${a}`,A=`Name: ${a}
2E-Mail: ${n}
3Thema: ${d}
4
5${i}`,{error:C}=await $.from("messages").insert({from_email:n,to_email:"[email protected]",subject:y,body:A,direction:"inbound",status:"unread"});if(C){l("Es ist ein Fehler aufgetreten. Bitte versuche es erneut."),r("error");return}try{localStorage.setItem("contact_last",JSON.stringify(Date.now()))}catch{}r("success")};return e.jsxs("div",{className:"mx-auto max-w-2xl px-5 md:px-8 py-12 md:py-20",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-[var(--accent)] uppercase tracking-[0.14em]",children:"Kontakt"}),e.jsxs("h1",{className:"mt-3 font-serif-display text-4xl md:text-5xl leading-tight",children:["Wie können",e.jsx("br",{}),"wir helfen?"]}),e.jsx("p",{className:"mt-5 text-[var(--muted)] text-base leading-relaxed",children:"Schreib uns – wir melden uns so schnell wie möglich bei dir."})]}),e.jsx("div",{className:"mt-14",children:e.jsx("div",{children:o==="success"?e.jsxs("div",{className:"rounded-2xl bg-white border border-[var(--line)] p-10 text-center",children:[e.jsx("div",{className:"mx-auto w-14 h-14 rounded-full bg-green-50 flex items-center justify-center mb-5",children:e.jsx(P,{className:"h-7 w-7 text-green-600"})}),e.jsx("h2",{className:"font-serif-display text-2xl",children:"Nachricht erhalten!"}),e.jsxs("p",{className:"mt-3 text-sm text-[var(--muted)] max-w-sm mx-auto",children:["Vielen Dank, ",a.split(" ")[0],". Wir melden uns so schnell wie moglich bei ",e.jsx("strong",{children:n}),"."]}),e.jsxs("a",{href:E({name:"home"}),onClick:t=>{t.preventDefault(),h({name:"home"})},className:"mt-8 inline-flex items-center gap-2 h-11 px-6 rounded-full bg-[var(--ink)] text-[var(--bg)] text-sm font-medium hover:bg-black transition-colors",children:["Zur Startseite ",e.jsx(u,{className:"h-4 w-4"})]})]}):e.jsxs("form",{onSubmit:k,className:"space-y-5",children:[e.jsx("div",{"aria-hidden":"true",style:{position:"absolute",left:"-9999px",width:"1px",height:"1px",overflow:"hidden"},children:e.jsxs("label",{children:["Webseite (bitte leer lassen)",e.jsx("input",{type:"text",tabIndex:-1,autoComplete:"off",value:m,onChange:t=>v(t.target.value)})]})}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-5",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-medium text-[var(--ink)] mb-1.5",children:["Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",required:!0,value:a,onChange:t=>p(t.target.value),placeholder:"Max Mustermann",className:"w-full h-11 px-4 roun
5ded-xl border border-[var(--line)] bg-white text-sm focus:outline-none focus:border-[var(--ink)] transition-colors placeholder:text-[var(--muted)]"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-medium text-[var(--ink)] mb-1.5",children:["E-Mail ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"email",required:!0,value:n,onChange:t=>g(t.target.value),placeholder:"[email protected]",className:"w-full h-11 px-4 rounded-xl border border-[var(--line)] bg-white text-sm focus:outline-none focus:border-[var(--ink)] transition-colors placeholder:text-[var(--muted)]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[var(--ink)] mb-1.5",children:"Thema"}),e.jsx("select",{value:d,onChange:t=>b(t.target.value),className:"w-full h-11 px-4 rounded-xl border border-[var(--line)] bg-white text-sm focus:outline-none focus:border-[var(--ink)] transition-colors",children:x.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-medium text-[var(--ink)] mb-1.5",children:["Nachricht ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{required:!0,value:i,onChange:t=>f(t.target.value),rows:7,placeholder:"Schildere dein Anliegen so detailliert wie moglich...",className:"w-full px-4 py-3 rounded-xl border border-[var(--line)] bg-white text-sm focus:outline-none focus:border-[var(--ink)] transition-colors placeholder:text-[var(--muted)] resize-none"})]}),o==="error"&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-red-600 bg-red-50 px-4 py-3 rounded-xl",children:[e.jsx(T,{className:"h-4 w-4 shrink-0"}),j]}),e.jsx("button",{type:"submit",disabled:o==="sending"||!a||!n||!i,className:"w-full h-12 rounded-xl bg-[var(--ink)] text-[var(--bg)] text-sm font-medium flex items-center justify-center gap-2 hover:bg-black transition-colors disabled:opacity-50",children:o==="sending"?e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"h-4 w-4 animate-spin"})," Wird gesendet..."]}):e.jsxs(e.Fragment,{children:["Nachricht senden ",e.jsx(u,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-[var(--muted)] text-center",children:"Mit dem Absenden stimmst du unserer Datenschutzerklarung zu."})]})})})]})}export{K as ContactPage};

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.