module.exports=[98767,a=>{"use strict";var b=a.i(20373),c=a.i(15704),d=a.i(46001);function e({requestId:a}){let[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(!1),i=(0,d.useRouter)(),j=async()=>{f(!0);try{(await fetch(`/api/requests/${a}`,{method:"DELETE"})).ok?(h(!1),i.refresh()):alert("Silme işlemi başarısız oldu.")}catch(a){console.error("Silme hatası:",a),alert("Bir hata oluştu.")}finally{f(!1)}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{type:"button",onClick:()=>h(!0),className:"text-red-500 hover:text-red-700 p-2 rounded hover:bg-red-50 transition-colors",title:"Kaydı Sil",children:(0,b.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}),g&&(0,b.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:(0,b.jsxs)("div",{className:"bg-white rounded-lg shadow-xl max-w-sm w-full p-6 text-center",children:[(0,b.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-2",children:"Kaydı Sil"}),(0,b.jsx)("p",{className:"text-gray-600 mb-6",children:"Bu geçmiş izin kaydını silmek istediğinize emin misiniz? Bu işlem geri alınamaz."}),(0,b.jsxs)("div",{className:"flex justify-center space-x-3",children:[(0,b.jsx)("button",{type:"button",onClick:()=>h(!1),disabled:e,className:"px-4 py-2 text-gray-700 bg-gray-100 rounded hover:bg-gray-200",children:"İptal"}),(0,b.jsx)("button",{type:"button",onClick:j,disabled:e,className:"px-4 py-2 text-white bg-red-600 rounded hover:bg-red-700 flex items-center",children:e?"Siliniyor...":"Evet, Sil"})]})]})})]})}a.s(["DeleteRequestButton",()=>e])}];

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