import{_ as b}from"./AdminLayout-bd13ff9d.js";import{_ as g}from"./PageHeader-8c638686.js";import{s as k,l as w,A as x,p as s,T as C,h,c,a as n,b as t,t as e,u as o,F as y,r as A,i as I,g as $,o as l,n as p,j as B}from"./app-13978987.js";import{_ as D}from"./Paginate-f61b79b2.js";import{h as F}from"./moment-a9aaa855.js";import M from"./OverviewGrid-21ea6fc2.js";import{d as L}from"./drawer-fe4c5e1a.js";import{_ as T}from"./NoDataFound-bc81d7fa.js";import"./dropdown-45d66330.js";const j={class:"container p-4 sm:p-6"},z={class:"space-y-6"},E={class:"table-responsive whitespace-nowrap rounded-primary"},N={class:"table"},S={class:"text-right"},V={key:0},O={class:"text-left"},R=["src"],Y={class:"text-left"},q={class:"text-left"},G={class:""},H={class:"dropdown","data-placement":"bottom-start"},J={class:"dropdown-toggle"},K={class:"dropdown-content w-40"},P={class:"dropdown-list"},Q={class:"dropdown-list-item"},U={class:"dropdown-list-item"},W=["onClick"],X=$({layout:b}),rt=Object.assign(X,{__name:"Index",props:["services","total","active","inActive","buttons"],setup(i){const{deleteRow:m}=k();w(()=>{L.init()});const d=i,f=x(()=>[{value:d.total,title:s("Total"),iconClass:"bx:badge"},{value:d.active,title:s("Active"),iconClass:"bx:badge-check"},{value:d.inActive,title:s("Inactive"),iconClass:"bx:x-circle"}]);return C({title:"",preview:"",short_description:"",description:"",is_featured:"",meta:{seo:{title:"",image:"",description:"",tags:""}},status:"active"}),(_,Z)=>{const r=h("Icon"),v=h("Link");return l(),c("main",j,[n(g,{title:"Services",buttons:i.buttons},null,8,["buttons"]),t("div",z,[n(M,{items:f.value,grid:"3"},null,8,["items"]),t("div",E,[t("table",N,[t("thead",null,[t("tr",null,[t("th",null,e(o(s)("Icon")),1),t("th",null,e(o(s)("Title")),1),t("th",null,e(o(s)("Category")),1),t("th",null,e(o(s)("Is Active")),1),t("th",null,e(o(s)("Is Featured")),1),t("th",null,e(o(s)("Created At")),1),t("th",null,[t("p",S,e(o(s)("Action")),1)])])]),i.services.total?(l(),c("tbody",V,[(l(!0),c(y,null,A(i.services.data,a=>{var u;return l(),c("tr",{key:a.id},[t("td",O,[t("img",{src:a.icon,class:"h-12 rounded",alt:"icon"},null,8,R)]),t("td",null,e(a.title),1),t("td",null,e((u=a.category)==null?void 0:u.title),1),t("td",Y,[t("span",{class:p(["badge",a.is_active?"badge-success":"badge-danger"])},e(a.is_active?o(s)("Active"):o(s)("Draft")),3)]),t("td",q,[t("span",{class:p(["badge",a.is_featured?"badge-success":""])},e(a.is_featured?o(s)("Featured"):"-"),3)]),t("td",null,e(o(F)(a.created_at).format("D-MMM-Y")),1),t("td",G,[t("div",H,[t("div",J,[n(r,{class:"text-2xl",icon:"bx:dots-horizontal-rounded"})]),t("div",K,[t("ul",P,[t("li",Q,[n(v,{href:_.route("admin.services.edit",a),class:"dropdown-link"},{default:B(()=>[n(r,{icon:"fe:edit"}),t("span",null,e(o(s)("Edit")),1)]),_:2},1032,["href"])]),t("li",U,[t("button",{as:"button",class:"dropdown-link",onClick:tt=>o(m)(_.route("admin.services.destroy",a.id))},[n(r,{icon:"fe:trash"}),t("span",null,e(o(s)("Delete")),1)],8,W)])])])])])])}),128))])):(l(),I(T,{key:1,"for-table":"true"}))])]),n(D,{links:i.services.links},null,8,["links"])])])}}});export{rt as default};
