import{f as y,g as p,a as n,h as e,i as u,w as h,e as a,F as i,j as m,k as _,o as s,P as c,t as r,l as b,b as x,n as g,W as v}from"./main-FivMmpKK.js";const k=e("ul",{class:"flex space-x-2 rtl:space-x-reverse"},[e("li",null,[e("a",{href:"javascript:;",class:"text-primary hover:underline"},"Clientes")]),e("li",{class:"before:content-['/'] ltr:before:mr-2 rtl:before:ml-2"},[e("span",null,"Listado")])],-1),w={class:"pt-5"},C={class:"panel"},j={class:"flex justify-between items-center"},N=e("h5",{class:"font-semibold text-lg dark:text-white-light"},"Clientes",-1),L=e("span",{class:"flex items-center"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 ltr:mr-2 rtl:ml-2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]),b(" Nuevo Cliente ")],-1),T={class:"table-responsive mt-5"},B={class:"table-hover"},E=e("thead",null,[e("tr",null,[e("th",null,"Nombre"),e("th",null,"Email"),e("th",null,"Teléfono"),e("th",null,"Ciudad"),e("th",{class:"text-center"},"Acciones")])],-1),M={class:"text-center"},H={class:"flex items-center justify-center gap-2"},V=["onClick"],q={key:0},F=e("td",{colspan:"5",class:"text-center"},"No hay clientes registrados",-1),O=[F],P={key:0,class:"flex items-center justify-between mt-5"},W={class:"flex gap-2"},$=["innerHTML"],D=Object.assign({layout:y},{__name:"Customers",props:{customers:{type:Object,required:!0}},setup(l){const f=o=>{confirm("¿Estás seguro de que deseas eliminar este cliente?")&&v.delete(route("customers.destroy",o))};return p(()=>{console.log("Componente Customers montado")}),(o,z)=>(s(),n("div",null,[k,e("div",w,[e("div",C,[e("div",j,[N,u(a(c),{href:o.route("customers.create"),class:"btn btn-primary btn-sm m-1"},{default:h(()=>[L]),_:1},8,["href"])]),e("div",T,[e("table",B,[E,e("tbody",null,[(s(!0),n(i,null,m(l.customers.data,t=>(s(),n("tr",{key:t.id},[e("td",null,r(t.name),1),e("td",null,r(t.email),1),e("td",null,r(t.phone),1),e("td",null,r(t.city),1),e("td",M,[e("ul",H,[e("li",null,[u(a(c),{href:o.route("customers.edit",t.id),class:"btn btn-sm btn-outline-primary"},{default:h(()=>[b(" Editar ")]),_:2},1032,["href"])]),e("li",null,[e("button",{type:"button",onClick:d=>f(t.id),class:"btn btn-sm btn-outline-danger"}," Eliminar ",8,V)])])])]))),128)),l.customers.data.length===0?(s(),n("tr",q,O)):_("",!0)])])]),l.customers.links&&l.customers.links.length>3?(s(),n("div",P,[e("div",W,[(s(!0),n(i,null,m(l.customers.links,(t,d)=>(s(),n(i,{key:d},[t.url?(s(),x(a(c),{key:0,href:t.url,class:g(["btn btn-outline-primary btn-sm",{"btn-primary":t.active}]),innerHTML:t.label},null,8,["href","class","innerHTML"])):(s(),n("span",{key:1,class:"btn btn-outline-primary btn-sm opacity-50 cursor-not-allowed",innerHTML:t.label},null,8,$))],64))),128))])])):_("",!0)])])]))}});export{D as default};
