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