import{_ as v}from"./AdminLayout-bd13ff9d.js";import{_ as b}from"./PageHeader-8c638686.js";import{s as x,p as s,h,c as r,a as n,b as t,t as o,u as e,F as g,r as k,g as w,o as _,n as C,j as P}from"./app-13978987.js";import{_ as y}from"./Paginate-f61b79b2.js";import A from"./OverviewGrid-21ea6fc2.js";import"./dropdown-45d66330.js";const I={class:"container p-4 sm:p-6"},$={class:"space-y-6"},z={class:"table-responsive whitespace-nowrap rounded-primary"},B={class:"table"},D={class:"!text-right"},E={class:"text-left"},L={class:"text-left"},S=["href"],j={class:"text-left"},F={class:"dropdown","data-placement":"bottom-start"},N={class:"dropdown-toggle"},T={class:"dropdown-content w-40"},V={class:"dropdown-list"},H={class:"dropdown-list-item"},O={class:"dropdown-list-item"},R=["onClick"],U=w({layout:v}),Y=Object.assign(U,{__name:"Index",props:["pages","totalActivePosts","totalInActivePosts","totalPosts"],setup(l){const{textExcerpt:u,deleteRow:m}=x(),i=l,p=[{value:i.totalPosts,title:s("Total Page"),iconClass:"bx:bar-chart"},{value:i.totalActivePosts,title:s("Active Page"),iconClass:"bx:check-circle"},{value:i.totalInActivePosts,title:s("Inactive Page"),iconClass:"bx:x-circle"}];return(c,q)=>{const d=h("Icon"),f=h("Link");return _(),r("main",I,[n(b),t("div",$,[n(A,{items:p,grid:"3"}),t("div",z,[t("table",B,[t("thead",null,[t("tr",null,[t("th",null,o(e(s)("Title")),1),t("th",null,o(e(s)("Url")),1),t("th",null,o(e(s)("Status")),1),t("th",null,o(e(s)("Created At")),1),t("th",D,o(e(s)("Action")),1)])]),t("tbody",null,[(_(!0),r(g,null,k(l.pages.data,a=>(_(),r("tr",{key:a.id},[t("td",E,o(e(u)(a.title,50)),1),t("td",L,[t("a",{href:c.sanitizeHtml(a.posturl),target:"_blank",class:"hover:text-primary-400 hover:underline"},o(e(u)(a.posturl,100)),9,S)]),t("td",j,[t("span",{class:C(["badge",a.status==1?"badge-success":"badge-danger"])},o(a.status==1?e(s)("Active"):e(s)("Draft")),3)]),t("td",null,o(a.created_at_diff),1),t("td",null,[t("div",F,[t("div",N,[n(d,{class:"text-2xl",icon:"bx:dots-horizontal-rounded"})]),t("div",T,[t("ul",V,[t("li",H,[n(f,{href:c.route("admin.page.edit",a.id),class:"dropdown-link"},{default:P(()=>[n(d,{icon:"fe:edit"}),t("span",null,o(e(s)("Edit")),1)]),_:2},1032,["href"])]),t("li",O,[t("button",{as:"button",class:"dropdown-link",onClick:G=>e(m)(c.route("admin.page.destroy",a.id))},[n(d,{icon:"fe:trash"}),t("span",null,o(e(s)("Delete")),1)],8,R)])])])])])]))),128))])]),n(y,{links:l.pages.links},null,8,["links"])])])])}}});export{Y as default};
