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