import{r as t,j as e,a as v,J as n,f as h}from"./app-BZJf8lgN.js";import{c as x,C as j}from"./confirmdialog.esm-DF1Ea2vk.js";import{L as S}from"./layout-DZ5xjWdd.js";import{B as l}from"./button.esm-D_cwsnQR.js";import{D as g,C as s}from"./column.esm-BrHEUUD7.js";import{T as y}from"./toast.esm-CYGIlaDH.js";import"./dialog.esm-B_DzXfDY.js";import"./csstransition.esm-BNRxTMOa.js";import"./hooks.esm-UVLztt_0.js";import"./CSSTransition-DBuKQJwM.js";import"./index.esm-hRnQzR_k.js";import"./overlayservice.esm-B-BnP5c1.js";import"./inputtext.esm-B1lZn37a.js";import"./index.esm-mvXJc0W-.js";import"./dropdown.esm-HqLoOpxI.js";import"./index.esm-CygY3Qsw.js";import"./index.esm-Ckth6fI3.js";import"./index.esm-B5zYYMSp.js";const M=({servicios:c})=>{const r=t.useRef(null),[b,E]=t.useState(!1),[N,w]=t.useState(!1),[C,D]=t.useState(null),[o,a]=t.useState(null),d=i=>{a(i)},m=i=>e.jsx("img",{src:`${i.imagen}`,alt:i.imagen,className:"w-10rem shadow-2 border-round"}),u=i=>e.jsxs(e.Fragment,{children:[" ",e.jsxs(n,{type:"button",icon:"pi pi-pencil",href:route("servicios.edit",i.id),children:["  ",e.jsx(l,{type:"button",icon:"pi pi-pencil"})]})," ",e.jsx(l,{type:"button",icon:"pi pi-times",severity:"danger",onClick:()=>d(i.id)})," "]}),p=()=>{h.delete(route("servicios.destroy",o),{onSuccess:()=>{r.current.show({severity:"info",summary:"Servicio Eliminado",detail:"Se ha eliminado un Servicio",life:3e3})}}),a(null)},f=()=>{r.current.show({severity:"warn",summary:"Cancelado",detail:"No se ha eliminado nada",life:3e3}),a(null)};return t.useEffect(()=>{o!=null&&x({message:"Esta seguro/a que desea eliminar un Servicio?",header:"Eliminar Servicio",icon:"pi pi-exclamation-triangle",defaultfocus:"accept",accept:p,reject:f})},[o]),e.jsxs(S,{children:[e.jsx(j,{}),e.jsx(v,{title:"Editar Servicios"}),e.jsx("div",{className:"grid",children:e.jsx("div",{className:"col-md-12",children:e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"card-header",style:{marginLeft:"80%"},children:e.jsx(n,{className:"p-button mb-2",href:route("servicios.create"),style:{color:"white"},children:"Agregar Servicio"})}),e.jsx(y,{ref:r}),e.jsxs(g,{value:c,tableStyle:{minWidth:"50rem"},children:[e.jsx(s,{field:"orden",header:"Orden"}),e.jsx(s,{field:"titulo",header:"Titulo"}),e.jsx(s,{field:"imagen",header:"Imagen",body:m}),e.jsx(s,{header:"Acciones",body:u})]})]})})})]})};export{M as default};
//# sourceMappingURL=Index-DhtO1byQ.js.map
