import{Z as b,i as g,r as o,c as r,o as i,a as e,b as t,w as d,t as m,f as w,F as x,j as k,e as v}from"./app-BLo7SiiE.js";import{I as V}from"./moment-C7JtfGJw.js";import{t as N,S as L,p as I}from"./SearchInput-BQxs0-MZ.js";import{L as S}from"./Layout-BEAmuehS.js";import{m as j}from"./mapValues-BsTqcYnb.js";import{P as B}from"./Pagination-Bj-Q2plQ.js";import{_ as C}from"./FlashMessages-DImpr6PL.js";const H={metaInfo:{title:"Types"},components:{SearchInput:L,Icon:V,Link:g,Head:b,Pagination:B},layout:S,props:{title:String,filters:Object,types:Object},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:N(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,$,f,p){const u=o("Head"),h=o("search-input"),c=o("Link"),_=o("icon"),y=o("pagination");return i(),r("div",null,[e(u,{title:l.$t(a.title)},null,8,["title"]),t("div",F,[e(h,{modelValue:f.form.search,"onUpdate:modelValue":n[0]||(n[0]=s=>f.form.search=s),class:"w-full max-w-md mr-4",onReset:p.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(x,null,k(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)]))):w("",!0)])])]),e(y,{class:"mt-6",links:a.types.links},null,8,["links"])])}const Q=C(H,[["render",Z]]);export{Q as default};
