PageSourceSearch

https://www.ceddcozum.com/assets/ContactPage-CV9vxM8g.js

js ceddcozum.com collected 2026-10-02 00:07:48 UTC 5,229 bytes, 1 lines download raw bytes

1import{r as x,j as e,u as b}from"./vendor-D3et-OR1.js";import{a as f,b as v,_ as y,$ as N,a0 as C,a1 as w,a2 as S,I as u}from"./index-ppzD9w8I.js";import{C as k,L as c}from"./label-B9bIah-Q.js";import{C as T}from"./circle-alert-BIcAIWDK.js";import{S as F}from"./send-BQKI8JE2.js";import"./i18n-Lgj2Bm8L.js";import"./ui-B676v3Vd.js";import"./utils-CbsVbbwn.js";const g=x.forwardRef(({className:t,...o},r)=>e.jsx("textarea",{className:f("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...o}));g.displayName="Textarea";function G(){const{t,i18n:o}=b();v(t("contact.pageTitle","Contact"));const[r,n]=x.useState("idle"),[s,p]=x.useState({subject:"content",name:"",email:"",phone:"",message:""}),h=[{value:"content",label:t("contact.form.subjectContent","İçerik")},{value:"technical",label:t("contact.form.subjectTechnical","Teknik")},{value:"feature",label:t("contact.form.subjectFeature","Öneri")},{value:"other",label:t("contact.form.subjectOther","Diğer")}],i=(a,m)=>p(l=>({...l,[a]:m})),j=async a=>{if(a.preventDefault(),!(!s.name.trim()||!s.email.trim()||!s.message.trim())){n("sending");try{const m=h.find(d=>d.value===s.subject)?.label??s.subject,l=await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subject:m,name:s.name,email:s.email,phone:s.phone,message:s.message,_hp:document.getElementById("_hp")?.value||"",locale:o.language})});if(!l.ok){const d=await l.json().catch(()=>({}));if(l.status===429){n("error");return}throw new Error(d.error||"Failed")}n("sent"),p({subject:"content",name:"",email:"",phone:"",message:""})}catch{n("error")}}};return e.jsx("div",{className:"flex-1 px-6 pt-6 sm:px-6 sm:pt-6 lg:px-8 lg:pt-8 pb-12",children:e.jsxs("div",{className:"max-w-2xl mx-auto w-full space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:t("contact.title","İletişim")}),e.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-relaxed",children:t("contact.subtitle","Geri bildirimleriniz, hata raporlarınız ve önerileriniz için bizimle iletişime geçin.")})]}),r==="sent"?e.jsxs("div",{className:"rounded-lg border border-green-200 dark:border-green-800 bg-green-50 dark:bg-green-950/30 p-6 text-center space-y-2",children:[e.jsx(k,{className:"h-8 w-8 text-green-600 dark:text-green-400 mx-auto"}),e.jsx("p",{className:"font-medium text-green-800 dark:text-green-300",children:t("contact.form.successTitle","Mesajınız gönderildi")}),e.jsx("p",{className:"text-sm text-green-700 dark:text-green-400",children:t("contact.form.successMessage","En kısa sürede size dönüş yapacağız.")}),e.jsx("button",{type:"button",onClick:()=>n("idle"),className:"text-sm text-primary hover:underline mt-2",children:t("contact.form.sendAnother","Yeni mesaj gönder")})]}):e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[e.jsx("input",{type:"text",id:"_hp",name:"_hp",tabIndex:-1,autoComplete:"off","aria-hidden":"true",className:"absolute opacity-0 h-0 w-0 pointer-events-none"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{htmlFor:"subject",children:t("contact.form.subject","Konu")}),e.jsxs(y,{value:s.subject,onValueChange:a=>i("subject",a),children:[e.jsx(N,{className:"h-9",children:e.jsx(C,{})}),e.jsx(w,{children:h.map(a=>e.jsx(S,{value:a.value,children:a.label},a.value))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(c,{htmlFor:"name",children:[t("contact.form.name","Ad Soyad")," ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"name",value:s.name,onChange:a=>i("name",a.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(c,{htmlFor:"email",children:[t("contact.form.email","E-posta")," ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(u,{id:"email",type:"email",value:s.email,onChange:a=>i("email",a.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{htmlFor:"phone",children:t("contact.form.phone","Telefon")}),e.jsx(u,{id:"phone",type:"tel",value:s.phone,onChange:a=>i("phone",a.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(c,{htmlFor:"message",children:[t("contact.form.message","Mesaj")," ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(g,{id:"message",value:s.message,onChange:a=>i("message",a.target.value),rows:5,required:!0})]}),r==="error"&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[e.jsx(T,{className:"h-4 w-4"}),t("contact.form.error","Bir hata oluştu. Lütfen tekrar deneyin.")]}),e.jsxs("button",{type:"submit",disabled:r==="sending",className:"inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow hover:bg-primary/90 disabled:opacity-50 transition-colors",children:[e.jsx(F,{className:"h-4 w-4"}),r==="sending"?t("contact.form.sending","Gönderiliyor..."):t("contact.form.send","Gönder")]})]})]})})}export{G 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.