import{I as g}from"./LogoutButton-BZlSuKxY.js";import{p as x}from"./pickBy-_N4B5OFc.js";import{L as w}from"./Layout-DhxLvS0V.js";import{t as k}from"./throttle-DRsYW0Dx.js";import{m as v}from"./mapValues-CJnTf0SX.js";import{P as V}from"./Pagination-D_wo4K-u.js";import{S as B}from"./SearchInput-CQhaAWWY.js";import{X as C,B as L,C as i,j as c,t as p,m as o,k as t,E as n,y as r,z as I,F as N,q as S,x as m}from"./vendor-CoimUlS3.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./app-W9XHfen4.js";import"./utils-CXPYudwi.js";/* empty css                                                                 */import"./ui-CI37mw-K.js";import"./Logo-DiOikIGZ.js";import"./FlashMessages-D1juQjH6.js";const $={metaInfo:{title:"Blog posts"},components:{Icon:g,Pagination:V,SearchInput:B,Link:L,Head:C},layout:w,props:{filters:Object,posts:Object,title:String},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:k(function(){this.$inertia.get(this.route("posts"),x(this.form),{preserveState:!0})},150)}},methods:{reset(){this.form=v(this.form,()=>null)}}},A={class:"mb-6 flex justify-between items-center"},H={class:"bg-white rounded-md shadow overflow-x-auto"},T={class:"w-full whitespace-nowrap"},E={class:"text-left font-bold"},F={class:"px-6 pt-6 pb-4"},O={class:"px-6 pt-6 pb-4"},P={class:"px-6 pt-6 pb-4"},R={class:"border-t"},q={class:"border-t"},z={class:"border-t"},D={class:"border-t"},U={class:"border-t w-px"},X={key:0},G={class:"border-t px-6 py-4",colspan:"4"};function J(e,l,d,K,f,h){const u=i("Head"),_=i("search-input"),a=i("Link"),b=i("icon"),y=i("pagination");return p(),c("div",null,[o(u,{title:e.$t(d.title)},null,8,["title"]),t("div",A,[o(_,{modelValue:f.form.search,"onUpdate:modelValue":l[0]||(l[0]=s=>f.form.search=s),class:"w-full max-w-md mr-4",onReset:h.reset},null,8,["modelValue","onReset"]),o(a,{class:"btn-indigo",href:e.route("posts.create")},{default:n(()=>[t("span",null,r(e.$t("Create a new post")),1)]),_:1},8,["href"])]),t("div",H,[t("table",T,[t("tbody",null,[t("tr",E,[t("th",F,r(e.$t("Title")),1),t("th",O,r(e.$t("Type")),1),t("th",P,r(e.$t("Is Active")),1),l[1]||(l[1]=t("th",{class:"px-6 pt-6 pb-4"},"Created At",-1))]),(p(!0),c(N,null,S(d.posts.data,s=>(p(),c("tr",{key:s.id,class:"hover:bg-gray-100 focus-within:bg-gray-100"},[t("td",R,[o(a,{class:"px-6 py-4 flex items-center focus:text-indigo-500",href:e.route("posts.edit",s.id)},{default:n(()=>[m(r(s.title),1)]),_:2},1032,["href"])]),t("td",q,[o(a,{class:"px-6 py-4 flex items-center",href:e.route("posts.edit",s.id),tabindex:"-1"},{default:n(()=>[m(r(s.type),1)]),_:2},1032,["href"])]),t("td",z,[o(a,{class:"px-6 py-4 flex items-center",href:e.route("posts.edit",s.id),tabindex:"-1"},{default:n(()=>[m(r(s.isActive),1)]),_:2},1032,["href"])]),t("td",D,[o(a,{class:"px-6 py-4 flex items-center",href:e.route("posts.edit",s.id),tabindex:"-1"},{default:n(()=>[m(r(s.created_at),1)]),_:2},1032,["href"])]),t("td",U,[o(a,{class:"px-4 flex items-center",href:e.route("posts.edit",s.id),tabindex:"-1"},{default:n(()=>[o(b,{name:"cheveron-right",class:"block w-6 h-6 fill-gray-400"})]),_:1},8,["href"])])]))),128)),d.posts.data.length===0?(p(),c("tr",X,[t("td",G,r(e.$t("No post base found.")),1)])):I("",!0)])])]),o(y,{class:"mt-6",links:d.posts.links},null,8,["links"])])}const ct=j($,[["render",J]]);export{ct as default};
