import{i as x,r,c as a,o as l,b as t,a as o,t as i,w as m,e as h,f as g,F as w,j as k}from"./app-BhD6J0Va.js";import{I as y}from"./moment-DeOISj6Y.js";import{t as v,S as V,p as C}from"./SearchInput-BhrnFjZw.js";import{L}from"./Layout-BNWXhjq5.js";import{m as N}from"./mapValues-DT3qyRA0.js";import{P as I}from"./Pagination-KBt07-7T.js";import{_ as j}from"./FlashMessages-DW2Y2mP0.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("  ",-1)),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(w,null,k(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"})]),_:1},8,["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)])])):g("",!0)])])]),o(b,{class:"mt-6",links:c.cities.links},null,8,["links"])])}const W=j(B,[["render",q]]);export{W as default};
