import{Z as g,i as w,r as i,c as l,a as r,b as t,w as n,t as o,F as k,j as $,h as f,o as c,e as d}from"./app-CK3cEAAe.js";import{I as v}from"./moment-BywspGD9.js";import{S as V,t as C,p as N}from"./SearchInput-C5NjNnwl.js";import{L}from"./Layout-DIVdUaBZ.js";import{m as j}from"./mapValues-BykAXOI1.js";import{P as B}from"./Pagination-MejnxKj7.js";import{_ as I}from"./FlashMessages-ByEdcHWZ.js";const S={components:{SearchInput:V,Head:g,Icon:v,Link:w,Pagination:B},layout:L,props:{filters:Object,users:Object},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:C(function(){this.$inertia.get(this.route("customers"),N(this.form),{preserveState:!0})},150)}},methods:{reset(){this.form=j(this.form,()=>null)}}},H={class:"flex items-center justify-between mb-6"},P={class:"bg-white rounded-md shadow overflow-x-auto"},E={class:"w-full whitespace-nowrap"},F={class:"text-left font-bold"},O={class:"pb-4 pt-6 px-6"},R={class:"pb-4 pt-6 px-6"},D={class:"pb-4 pt-6 px-6"},T={class:"pb-4 pt-6 px-6"},U={class:"pb-4 pt-6 px-6"},Z={class:"border-t"},q=["src"],z={class:"border-t"},A={class:"border-t"},G={class:"border-t"},J={class:"border-t"},K={class:"w-px border-t"},M={key:0},Q={class:"px-6 py-4 border-t",colspan:"5"};function W(e,h,m,X,p,u){const _=i("Head"),b=i("search-input"),a=i("Link"),y=i("icon"),x=i("pagination");return c(),l("div",null,[r(_,{title:e.$t("Customers")},null,8,["title"]),t("div",H,[r(b,{modelValue:p.form.search,"onUpdate:modelValue":h[0]||(h[0]=s=>p.form.search=s),class:"mr-4 w-full max-w-md",onReset:u.reset},null,8,["modelValue","onReset"]),r(a,{class:"btn-indigo",href:e.route("customers.create")},{default:n(()=>[t("span",null,o(e.$t("Create New")),1)]),_:1},8,["href"])]),t("div",P,[t("table",E,[t("tbody",null,[t("tr",F,[t("th",O,o(e.$t("Name")),1),t("th",R,o(e.$t("Email")),1),t("th",D,o(e.$t("Phone")),1),t("th",T,o(e.$t("City")),1),t("th",U,o(e.$t("Created")),1)]),(c(!0),l(k,null,$(m.users.data,s=>(c(),l("tr",{key:s.id,class:"hover:bg-gray-100 focus-within:bg-gray-100"},[t("td",Z,[r(a,{class:"flex items-center px-6 py-4 focus:text-indigo-500",href:e.route("customers.edit",s.id)},{default:n(()=>[s.photo?(c(),l("img",{key:0,class:"block -my-2 mr-2 w-5 h-5 rounded-full",src:s.photo},null,8,q)):f("",!0),d(" "+o(s.name),1)]),_:2},1032,["href"])]),t("td",z,[r(a,{class:"flex items-center px-6 py-4",href:e.route("customers.edit",s.id),tabindex:"-1"},{default:n(()=>[d(o(s.email),1)]),_:2},1032,["href"])]),t("td",A,[r(a,{class:"flex items-center px-6 py-4",href:e.route("customers.edit",s.id),tabindex:"-1"},{default:n(()=>[d(o(s.phone),1)]),_:2},1032,["href"])]),t("td",G,[r(a,{class:"flex items-center px-6 py-4",href:e.route("customers.edit",s.id),tabindex:"-1"},{default:n(()=>[d(o(e.$t(s.city)),1)]),_:2},1032,["href"])]),t("td",J,[r(a,{class:"flex items-center px-6 py-4",href:e.route("customers.edit",s.id),tabindex:"-1"},{default:n(()=>[d(o(e.$t(s.created_at)),1)]),_:2},1032,["href"])]),t("td",K,[r(a,{class:"flex items-center px-4",href:e.route("customers.edit",s.id),tabindex:"-1"},{default:n(()=>[r(y,{name:"cheveron-right",class:"block w-6 h-6 fill-gray-400"})]),_:2},1032,["href"])])]))),128)),m.users.data.length===0?(c(),l("tr",M,[t("td",Q,o(e.$t("No customers found.")),1)])):f("",!0)])])]),r(x,{class:"mt-6",links:m.users.links},null,8,["links"])])}const nt=I(S,[["render",W]]);export{nt as default};
