import{Z as x,i as w,r as n,c,o as d,a as s,b as t,w as u,t as o,f as y,F as k,j as v,e as f}from"./app-BLo7SiiE.js";import{I as S}from"./moment-C7JtfGJw.js";import{t as V,S as L,p as N}from"./SearchInput-BQxs0-MZ.js";import{L as I}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:"Statuses"},components:{SearchInput:L,Icon:S,Link:w,Head:x,Pagination:B},layout:I,props:{filters:Object,title:String,statuses:Object},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:V(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,h){const p=n("Head"),_=n("search-input"),l=n("Link"),b=n("icon"),g=n("pagination");return d(),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:h.reset},null,8,["modelValue","onReset"]),s(l,{class:"btn-indigo",href:this.route("statuses.create")},{default:u(()=>[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)]),(d(!0),c(k,null,v(i.statuses.data,e=>(d(),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:u(()=>[f(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:u(()=>[f(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:u(()=>[s(b,{name:"cheveron-right",class:"block w-6 h-6 fill-gray-400"})]),_:2},1032,["href"])])]))),128)),i.statuses.data.length===0?(d(),c("tr",q,r[1]||(r[1]=[t("td",{class:"border-t px-6 py-4",colspan:"4"},"No statuses found.",-1)]))):y("",!0)])])]),s(g,{class:"mt-6",links:i.statuses.links},null,8,["links"])])}const Y=C(H,[["render",z]]);export{Y as default};
