import{Z as g,i as w,r as a,c,o as d,a as s,b as t,f as y,t as o,F as k,j as v,w as m,e as f}from"./app-BLo7SiiE.js";import{I as V}from"./moment-C7JtfGJw.js";import{t as L,S as N,p as S}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:"Email Templates"},components:{Icon:V,Link:w,Head:g,Pagination:B,SearchInput:N},layout:I,props:{title:String,filters:Object,templates:Object},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:L(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,p,h){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:p.form.search,"onUpdate:modelValue":n[0]||(n[0]=e=>p.form.search=e),class:"w-full max-w-md mr-4",onReset:h.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(k,null,v(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)]))):y("",!0)])])]),s(b,{class:"mt-6",links:i.templates.links},null,8,["links"])])}const tt=C(H,[["render",A]]);export{tt as default};
