import{G as p,j as e,t as l}from"./app-C7YxHmQz.js";import{A as f,a as x,b as h,c as j,d as g}from"./alert-dialog-S-fo0VnI.js";import{B as n}from"./button-CJ9RiI_R.js";import{u as D}from"./useGradoStore-DNXbWJ5U.js";import"./index-CCZex4bU.js";import"./index-Cp62Blk_.js";import"./index-w2AxdR7H.js";import"./utils-DjqsqOe8.js";import"./react-3TENqYnz.js";function k(){const{grado:r,openModalDeleteGrado:c,setOpenModalDeleteGrado:a}=D(),{delete:d,processing:u}=p(),m=()=>{r!=null&&r.id&&d(route("grados.destroy",r.id),{preserveScroll:!0,onSuccess:s=>{var o,t;const i=((t=(o=s.props)==null?void 0:o.status)==null?void 0:t.success)??"Grado eliminado correctamente.";l.success(i),a(!1)},onError:s=>{var o,t;const i=((t=(o=s==null?void 0:s.props)==null?void 0:o.status)==null?void 0:t.error)||"Error en el formulario.";l.error(i)}})};return e.jsx(f,{open:c,onOpenChange:()=>a(!1),children:e.jsxs(x,{children:[e.jsxs(h,{children:[e.jsx(j,{children:"Eliminar Grado Escolar"}),e.jsxs(g,{children:['¿Estás seguro de que deseas eliminar el grado escolar "',r==null?void 0:r.nombre,'"? Esta acción no se puede deshacer.']})]}),e.jsxs("footer",{className:"flex justify-around gap-4 mt-4",children:[e.jsx(n,{type:"button",onClick:()=>a(!1),variant:"secondary",children:"Cancelar"}),e.jsx(n,{type:"button",onClick:m,disabled:u,variant:"destructive",children:"Eliminar"})]})]})})}export{k as ModalDeleteGrado};
