(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,123,e=>{"use strict";var t=e.i(36703),i=e.i(2286),r=e.i(19140);function s({requestId:e}){let[s,l]=(0,i.useState)(!1),[a,n]=(0,i.useState)(!1),o=(0,r.useRouter)(),d=async()=>{l(!0);try{(await fetch(`/api/requests/${e}`,{method:"DELETE"})).ok?(n(!1),o.refresh()):alert("Silme işlemi başarısız oldu.")}catch(e){console.error("Silme hatası:",e),alert("Bir hata oluştu.")}finally{l(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>n(!0),className:"text-red-500 hover:text-red-700 p-2 rounded hover:bg-red-50 transition-colors",title:"Kaydı Sil",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.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"})})}),a&&(0,t.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-xl max-w-sm w-full p-6 text-center",children:[(0,t.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-2",children:"Kaydı Sil"}),(0,t.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,t.jsxs)("div",{className:"flex justify-center space-x-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>n(!1),disabled:s,className:"px-4 py-2 text-gray-700 bg-gray-100 rounded hover:bg-gray-200",children:"İptal"}),(0,t.jsx)("button",{type:"button",onClick:d,disabled:s,className:"px-4 py-2 text-white bg-red-600 rounded hover:bg-red-700 flex items-center",children:s?"Siliniyor...":"Evet, Sil"})]})]})})]})}e.s(["DeleteRequestButton",()=>s])}]);