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