import{_ as f}from"./Paginate-D_g9VFI3.js";import{_ as v}from"./NoDataFound-Xi4CpDbx.js";import{s as b}from"./assetStore-BSVLrDIW.js";import{a as w,c as i,o,d as e,k as u,t as a,F as k,h as g,u as m,n as q,b as n,w as y,a1 as R,j as C,g as $}from"./app-fEKA3BkQ.js";import{_ as x}from"./UserLayout-D_lxcpvH.js";import{_ as j}from"./FilterDropdown-zriyDhiF.js";import"./PageHeader-DmRLoM5E.js";import"./ValidationErrors-B24rcOPH.js";import"./SpinnerBtn-BezRkGQj.js";const B={class:"table-responsive mt-4 w-full"},I={class:"table"},N={class:"w-8"},S={class:"w-32"},T={class:"w-32 !text-right"},V={key:0,class:"tbody"},D={class:"flex justify-end"},E={class:"dropdown","data-placement":"bottom-start"},L={class:"dropdown-toggle"},O={class:"dropdown-content w-56"},A={class:"dropdown-list"},F={class:"dropdown-list-item"},M={class:"dropdown-list-item"},z=["onClick"],G={class:"w-full"},H={__name:"List",props:{module:{type:String,required:!0},quickReplies:{type:Object,required:!0}},setup(s){const{deleteRow:c,textExcerpt:r,badgeClass:p}=b();return(t,J)=>{const d=w("Icon");return o(),i("div",B,[e("table",I,[e("thead",null,[e("tr",null,[e("th",N,a(t.trans("#")),1),e("th",null,a(t.trans("Message Template")),1),e("th",S,a(t.trans("Status")),1),e("th",T,a(t.trans("Action")),1)])]),s.quickReplies.data.length?(o(),i("tbody",V,[(o(!0),i(k,null,g(s.quickReplies.data,(l,_)=>{var h;return o(),i("tr",{key:_},[e("td",null,a(_+1),1),e("td",null,a(m(r)(l.message_template,160)),1),e("td",null,[e("span",{class:q(m(p)(l.status))},a(l.status==="active"?"active":"inactive"),3)]),e("td",null,[e("div",D,[e("div",E,[e("div",L,[n(d,{class:"h-5 text-3xl text-slate-400",icon:"bx:dots-vertical-rounded"})]),e("div",O,[e("ul",A,[e("li",F,[(o(),u(R(((h=t.$page.props)==null?void 0:h.activeModule)===s.module?"Link":"a"),{class:"dropdown-link",href:t.route(`user.${s.module}.quick-replies.edit`,l.id)},{default:y(()=>[n(d,{icon:"bx:bxs-edit-alt"}),e("span",null,a(t.trans("Edit")),1)]),_:2},1032,["href"]))]),e("li",M,[e("button",{class:"dropdown-link delete-confirm",onClick:K=>m(c)(t.route(`user.${s.module}.quick-replies.destroy`,l.id))},[n(d,{icon:"bx:trash"}),C(" "+a(t.trans("Delete")),1)],8,z)])])])])])])])}),128))])):(o(),u(v,{key:1,forTable:!0}))]),e("div",G,[s.quickReplies.data.length?(o(),u(f,{key:0,links:s.quickReplies.links},null,8,["links"])):$("",!0)])])}}},se=Object.assign({layout:x},{__name:"Index",props:["quickReplies"],setup(s){const c=s,r=[{label:"Template",value:"message_template"},{label:"Status",value:"status",options:[{label:"Active",value:"active"},{label:"Inactive",value:"inactive"}]}];return(p,t)=>(o(),i(k,null,[n(j,{options:r}),n(H,{module:"whatsapp",quickReplies:c.quickReplies},null,8,["quickReplies"])],64))}});export{se as default};
