import{_ as m}from"./ListTableActionLabel.vue_vue_type_script_setup_true_lang-DE9qVKFa.js";import{_ as y}from"./AppLayout.vue_vue_type_script_setup_true_lang-C-UlPCqH.js";import{d as _,o as r,a as l,b as a,e as o,h as g,w as n,f as e,l as p,i as x,F as c,n as b,t as d,j as u,q as h,D as v}from"./app-D9-EssCM.js";import{S as w}from"./square-pen-CvugRQ9Y.js";import{T as k}from"./trash-2-Dis-KatR.js";import"./index-CcjNLu6f.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-MNmriUeS.js";import"./VisuallyHidden-DG35s1YI.js";import"./RovingFocusGroup-Diffidi3.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./x-DwmBYYXD.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const T={class:"space-y-6 p-4"},N={class:"flex items-center justify-between"},j={class:"rounded-lg border bg-white shadow-sm"},C={class:"overflow-x-auto"},$={class:"min-w-full divide-y divide-gray-200"},D={class:"divide-y divide-gray-200 bg-white"},E={class:"px-4 py-3 text-sm font-medium text-gray-900"},S={key:0,class:"ml-2 inline-flex rounded-full bg-blue-100 px-2 py-0.5 text-xs text-blue-700"},V={class:"px-4 py-3 text-sm text-gray-700"},A={class:"px-4 py-3 text-sm"},B={class:"px-4 py-3 text-sm"},q={class:"flex items-center gap-2"},F=["onClick"],I={key:0},Z=_({__name:"Index",props:{templates:{},variableGroups:{}},setup(z){const f=i=>{confirm(`Delete email template "${i.name}"?`)&&v.delete(`/administration/email-templates/${i.id}`)};return(i,t)=>(r(),l(c,null,[a(o(g),{title:"Email Templates"}),a(y,{breadcrumbs:[{title:"Administration",href:"/administration"},{title:"Email Templates",href:"#"}]},{default:n(()=>[e("div",T,[e("div",N,[t[1]||(t[1]=e("div",null,[e("h1",{class:"text-2xl font-bold text-gray-900"},"Email Templates"),e("p",{class:"text-sm text-gray-600"},"Manage templates for customer and contact emails using the visual email editor.")],-1)),a(o(p),{href:"/administration/email-templates/create",class:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700"},{default:n(()=>[...t[0]||(t[0]=[x(" New Template ",-1)])]),_:1})]),e("div",j,[e("div",C,[e("table",$,[t[3]||(t[3]=e("thead",{class:"bg-gray-50"},[e("tr",null,[e("th",{class:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500"},"Name"),e("th",{class:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500"},"Subject"),e("th",{class:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500"},"Status"),e("th",{class:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500"},"Actions")])],-1)),e("tbody",D,[(r(!0),l(c,null,b(i.templates,s=>(r(),l("tr",{key:s.id},[e("td",E,[x(d(s.name)+" ",1),s.is_default?(r(),l("span",S," Default ")):u("",!0)]),e("td",V,d(s.subject),1),e("td",A,[e("span",{class:h([s.is_active?"bg-green-100 text-green-700":"bg-gray-100 text-gray-700","inline-flex rounded-full px-2 py-0.5 text-xs"])},d(s.is_active?"Active":"Inactive"),3)]),e("td",B,[e("div",q,[a(o(p),{href:`/administration/email-templates/${s.id}/edit`,class:"inline-flex items-center justify-center rounded border border-gray-300 px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50 md:px-3 md:py-1"},{default:n(()=>[a(m,{label:"Edit"},{default:n(()=>[a(o(w),{class:"h-4 w-4"})]),_:1})]),_:1},8,["href"]),e("button",{type:"button",onClick:G=>f(s),class:"inline-flex items-center justify-center rounded border border-red-300 px-2 py-1.5 text-xs font-medium text-red-700 hover:bg-red-50 md:px-3 md:py-1"},[a(m,{label:"Delete"},{default:n(()=>[a(o(k),{class:"h-4 w-4"})]),_:1})],8,F)])])]))),128)),i.templates.length===0?(r(),l("tr",I,[...t[2]||(t[2]=[e("td",{colspan:"4",class:"px-4 py-8 text-center text-sm text-gray-500"}," No email templates found. ",-1)])])):u("",!0)])])])])])]),_:1})],64))}});export{Z as default};
