import{r as m,S as x,j as e}from"./app-DB4YCWeF.js";import{W as h}from"./WithModal-BI-p938E.js";const u=i=>{const{data:t,handleClick:o}=i,n=`delete_${t==null?void 0:t.id}`,s=m.useRef(),{delete:c,processing:a}=x(),r=d=>{d.preventDefault(),c(`/admin/users/${t.id}`,{onSuccess:()=>{var l;(l=s.current)==null||l.click()}})};return e.jsx(h,{type:n,backdrop:!0,onClick:o,children:e.jsxs("form",{action:"",children:[e.jsx("h1",{className:"text-lg font-bold",children:"Konfirmasi"}),e.jsx("p",{children:"Apakah anda yakin ingin menghapus pengguna ini?"}),e.jsx("p",{className:"text-xl font-semibold text-center",children:t==null?void 0:t.title}),e.jsxs("div",{className:"modal-action",children:[e.jsx("label",{ref:s,htmlFor:`modal_${n}`,className:"btn btn-sm btn-neutral btn-outline",children:"Batal"}),e.jsx("button",{onClick:r,className:"btn btn-sm btn-error bg-red-600 text-white ",disabled:a,children:e.jsx("span",{className:`${a&&"loading"}`,children:"Hapus"})})]})]})})};export{u as default};
