import{_}from"./FilterDropdown-zriyDhiF.js";import{_ as f}from"./Paginate-D_g9VFI3.js";import{_ as b}from"./NoDataFound-Xi4CpDbx.js";import{s as w}from"./assetStore-BSVLrDIW.js";import{_ as k}from"./UserLayout-D_lxcpvH.js";import{a as y,c as l,o as a,b as n,d as s,k as v,t as e,F as d,h as g,n as x,g as N,j as c,u as C}from"./app-fEKA3BkQ.js";import"./SpinnerBtn-BezRkGQj.js";import"./PageHeader-DmRLoM5E.js";import"./ValidationErrors-B24rcOPH.js";const V={class:"table-responsive mt-4 w-full"},$={class:"table"},B={class:"!text-right"},D={key:0,class:"tbody"},T=["href"],j={class:"flex justify-end"},A={class:"dropdown","data-placement":"bottom-start"},E={class:"dropdown-toggle"},I={class:"dropdown-content w-56"},O={class:"dropdown-list"},S={class:"dropdown-list-item"},F=["href"],P={class:"dropdown-list-item"},R=["href"],z={class:"dropdown-list-item"},L=["onClick"],Z=Object.assign({layout:k},{__name:"Index",props:["overviews","templates"],setup(i){const{deleteRow:p}=w(),m=[{label:"Name",value:"name"},{label:"Status",value:"status"}];return(t,q)=>{const r=y("Icon");return a(),l(d,null,[n(_,{options:m}),s("div",V,[s("table",$,[s("thead",null,[s("tr",null,[s("th",null,e(t.trans("Template Name")),1),s("th",null,e(t.trans("Device Name")),1),s("th",null,e(t.trans("Type")),1),s("th",null,e(t.trans("Status")),1),s("th",B,e(t.trans("Action")),1)])]),i.templates.data.length?(a(),l("tbody",D,[(a(!0),l(d,null,g(i.templates.data,(o,h)=>{var u;return a(),l("tr",{key:h},[s("td",null,[s("a",{href:t.route("user.whatsapp.templates.show",o)},e(o.name),9,T)]),s("td",null,e(((u=o.platform)==null?void 0:u.name)??"NA"),1),s("td",null,e(o.type),1),s("td",null,[s("span",{class:x(["badge uppercase",["APPROVED","active"].includes(o.status)?"badge-success":"badge-warning"])},e(o.status),3)]),s("td",null,[s("div",j,[s("div",A,[s("div",E,[n(r,{class:"h-5 text-3xl text-slate-400",icon:"bx:dots-vertical-rounded"})]),s("div",I,[s("ul",O,[o.type!=="template"?(a(),l(d,{key:0},[s("li",S,[s("a",{class:"dropdown-link",href:t.route("user.whatsapp.templates.copy",o.id)},[n(r,{class:"h-5 text-3xl text-slate-400",icon:"bx:copy"}),c(" "+e(t.trans("Copy")),1)],8,F)]),s("li",P,[s("a",{class:"dropdown-link",href:t.route("user.whatsapp.templates.edit",o.id)},[n(r,{class:"h-5 text-3xl text-slate-400",icon:"bx:edit"}),c(" "+e(t.trans("Edit")),1)],8,R)])],64)):N("",!0),s("li",z,[s("button",{class:"dropdown-link delete-confirm",onClick:G=>C(p)(t.route("user.whatsapp.templates.destroy",o.id))},[n(r,{class:"h-5 text-3xl text-slate-400",icon:"bx:trash"}),c(" "+e(t.trans("Delete")),1)],8,L)])])])])])])])}),128))])):(a(),v(b,{key:1,forTable:!0}))])]),n(f,{links:i.templates.links},null,8,["links"])],64)}}});export{Z as default};
