import{i as g,Z as w,r as i,c as l,o as c,a as r,b as t,w as n,t as o,f,F as k,j as $,e as d}from"./app-BLo7SiiE.js";import{I as v}from"./moment-C7JtfGJw.js";import{t as V,S as C,p as N}from"./SearchInput-BQxs0-MZ.js";import{L}from"./Layout-BEAmuehS.js";import{m as j}from"./mapValues-BsTqcYnb.js";import{P as B}from"./Pagination-Bj-Q2plQ.js";import{_ as I}from"./FlashMessages-DImpr6PL.js";const S={components:{SearchInput:C,Head:w,Icon:v,Link:g,Pagination:B},layout:L,props:{filters:Object,users:Object},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:V(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};
