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