(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32233,e=>{"use strict";var s=e.i(36703),t=e.i(2286);function a(){let[e,a]=(0,t.useState)({host:"",port:"587",user:"",pass:"",from:""}),[l,r]=(0,t.useState)(!0),[o,d]=(0,t.useState)("");(0,t.useEffect)(()=>{!async function(){try{let e=await fetch("/api/settings/smtp");if(e.ok){let s=await e.json();a(e=>({...e,host:s.SMTP_HOST||"",port:s.SMTP_PORT||"587",user:s.SMTP_USER||"",from:s.SMTP_FROM||""}))}}catch(e){console.error(e)}finally{r(!1)}}()},[]);let c=async s=>{s.preventDefault(),d("");try{(await fetch("/api/settings/smtp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok?d("Ayarlar başarıyla kaydedildi"):d("Hata oluştu")}catch(e){d("Bağlantı hatası")}};return l?(0,s.jsx)("div",{children:"Yükleniyor..."}):(0,s.jsxs)("div",{className:"max-w-2xl mx-auto min-h-[calc(100vh-140px)] flex flex-col justify-center",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-800 mb-6",children:"Sistem Ayarları"}),(0,s.jsxs)("div",{className:"bg-white p-8 rounded-xl shadow-sm border border-gray-100",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-700 mb-4",children:"SMTP E-posta Ayarları"}),(0,s.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Giden Sunucusu adresi (SMTP Host)"}),(0,s.jsx)("input",{type:"text",placeholder:"smtp.example.com",className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 border px-3 py-2",value:e.host,onChange:s=>a({...e,host:s.target.value})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Giden Sunucusu Portu (SMTP Port)"}),(0,s.jsx)("input",{type:"text",placeholder:"587",className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 border px-3 py-2",value:e.port,onChange:s=>a({...e,port:s.target.value})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Kullanıcı Adı (E-posta Adresi)"}),(0,s.jsx)("input",{type:"text",placeholder:"info@example.com",className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 border px-3 py-2",value:e.user,onChange:s=>a({...e,user:s.target.value})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"E-posta Şifresi"}),(0,s.jsx)("input",{type:"password",placeholder:"********",className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 border px-3 py-2",value:e.pass,onChange:s=>a({...e,pass:s.target.value})}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Yalnızca değiştirmek isterseniz doldurun."})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Gönderen Başlığı (From Name/Email)"}),(0,s.jsx)("input",{type:"email",placeholder:"no-reply@example.com",className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 border px-3 py-2",value:e.from,onChange:s=>a({...e,from:s.target.value})})]}),o&&(0,s.jsx)("p",{className:"text-blue-600 text-sm",children:o}),(0,s.jsx)("div",{className:"flex justify-end pt-4",children:(0,s.jsx)("button",{type:"submit",className:"bg-[#0082ca] text-white px-6 py-2 rounded-lg hover:bg-[#006bb3]",children:"Ayarları Kaydet"})})]})]})]})}e.s(["default",()=>a])}]);