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