import{h as g}from"./moment-a9aaa855.js";import{_ as S}from"./NoDataFound-bc81d7fa.js";import{_ as k}from"./Filter-ccd66554.js";import x from"./OverviewGrid-21ea6fc2.js";import{_ as v}from"./Paginate-f61b79b2.js";import{p as a,c as u,a as r,b as t,t as s,u as n,F as y,r as C,i as w,g as $,o as i,j as p,k as m,z as f,n as j}from"./app-13978987.js";import{_ as T}from"./AdminLayout-bd13ff9d.js";import{_ as q}from"./PageHeader-8c638686.js";import"./dropdown-45d66330.js";const B={class:"container flex-grow p-4 sm:p-6"},N={class:"space-y-6"},V={class:"table-responsive whitespace-nowrap rounded-primary"},Y={class:"table"},D={class:"text-end"},M={key:0},O={class:"text-center"},z=["href"],F={class:"text-center"},A={class:"text-center"},E=["href"],I={class:"text-center"},P={class:"flex justify-end"},U=$({layout:T}),Z=Object.assign(U,{__name:"Index",props:["buttons","request","supports","pendingSupport","openSupport","closedSupport","totalSupports","type"],setup(o){const l=o,h=[{value:l.totalSupports,title:a("Total Supports"),iconClass:"bx:bar-chart"},{value:l.pendingSupport,title:a("Pending Supports"),iconClass:"bx:badge"},{value:l.openSupport,title:a("Open Supports"),iconClass:"bx:archive-out"},{value:l.closedSupport,title:a("Closed Supports"),iconClass:"bx:archive-in"}];function b(c,d){return c.length<=d?c:c.substring(0,d)+"..."}return(c,d)=>(i(),u("main",B,[r(q,{title:"Supports",buttons:o.buttons},null,8,["buttons"]),t("div",N,[r(x,{items:h}),r(k,{request:o.request,buttons:o.buttons,filterType:"support"},null,8,["request","buttons"]),t("div",V,[t("table",Y,[t("thead",null,[t("tr",null,[t("th",null,s(n(a)("Ticket No")),1),t("th",null,s(n(a)("Subject")),1),t("th",null,s(n(a)("Conversations")),1),t("th",null,s(n(a)("Status")),1),t("th",null,s(n(a)("User")),1),t("th",null,s(n(a)("Created At")),1),t("th",null,[t("p",D,s(n(a)("Ticket")),1)])])]),o.supports.total?(i(),u("tbody",M,[(i(!0),u(y,null,C(o.supports.data,e=>{var _;return i(),u("tr",{key:e.id},[t("td",O,[r(n(f),{href:"/admin/support/"+e.id},{default:p(()=>[m(s(e.ticket_no),1)]),_:2},1032,["href"])]),t("td",null,[t("a",{class:"text-dark",href:"/admin/support/"+e.id},s(b(e.subject,50)),9,z)]),t("td",F,s(e.conversations_count),1),t("td",null,[t("span",{class:j(e.status==2?"badge badge-warning":e.status==1?"badge badge-success":"badge badge-danger")},s(n(a)(e.status==2?"pending":e.status==1?"Open":"Closed")),3)]),t("td",A,[t("a",{href:"/admin/customer/"+e.user_id,class:"text-dark"},s(((_=e.user)==null?void 0:_.name)??""),9,E)]),t("td",I,s(n(g)(e.created_at).format("DD MMM, YYYY")),1),t("td",null,[t("div",P,[r(n(f),{href:"/admin/support/"+e.id,class:"btn btn-primary btn-sm"},{default:p(()=>[m(s(n(a)("View")),1)]),_:2},1032,["href"])])])])}),128))])):(i(),w(S,{key:1,"for-table":"true"}))]),r(v,{links:o.supports.links},null,8,["links"])])])]))}});export{Z as default};
