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

//# sourceMappingURL=Documents_koruyucu-izin-sistemi_app_dashboard_hr_settings_page_tsx_4710eef2._.js.map