import{u,r as w,cP as N,j as e,H as y,L as C,ch as T,cQ as R,c3 as S,x as v,cR as M,cS as _,cT as B,cU as F,cV as P}from"./vendor-rThclpOQ.js";import{T as H}from"./table-filter-YjsfaEUk.js";import{T as D}from"./table-footer-CXgex4hi.js";import{T as E}from"./table-header-Cuecslh2.js";import{B as I}from"./button-ZcsoqUQn.js";import{C as t,a as o,c as i,b as d}from"./card-HXna_7vU.js";import{T as L,a as k,b as p,c as h}from"./table-DoQbaWlF.js";import{D as A}from"./layout-Dtu8Rjtg.js";import V from"./table-columns-C8qyJQRy.js";import"./use-lang-BK6P2WMc.js";import"./debounce-CWHP_ANh.js";import"./route-B4ZMN77y.js";import"./utils-8KAaAB9H.js";import"./dropdown-menu-Cm0H42C1.js";import"./scroll-area-BCwyUKIK.js";import"./table-page-size-FBmivxVb.js";import"./index-DquVdLUg.js";import"./sidebar-Buyv7mEV.js";import"./separator-Cir9hccx.js";import"./sheet-BfC102Vr.js";import"./tooltip-WOIaUmuC.js";import"./main-CC75Iw88.js";import"./sonner-CgbrDmPW.js";import"./index-CWNIUFqh.js";import"./appearance-Bwg83W1G.js";import"./app-BsPpMpSR.js";/* empty css            */import"./language-BmlkXzFK.js";import"./notification-Bti7isEF.js";import"./popover-otAaS-4X.js";import"./app-logo-Bj2M2lhk.js";import"./accordion-by19KtHq.js";import"./avatar-BsP_s7dr.js";import"./delete-modal-CrLtMjfS.js";import"./dialog-CDEDwQhm.js";const q=()=>{var x;const{props:a}=u(),{blogs:c,statistics:r,translate:j}=a,{dashboard:s,frontend:b}=j,[f,g]=w.useState([]),l=N({data:c.data,columns:V(a.translate),onSortingChange:g,getCoreRowModel:P(),getSortedRowModel:F(),getFilteredRowModel:B(),state:{sorting:f}});return e.jsxs(e.Fragment,{children:[e.jsx(y,{title:s.blog}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:s.blog}),e.jsx(I,{asChild:!0,children:e.jsxs(C,{href:route("blogs.create"),children:[e.jsx(T,{className:"mr-2 h-4 w-4"}),s.add_new_blog]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsxs(t,{children:[e.jsxs(o,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(i,{className:"text-sm font-medium",children:s.total_blogs}),e.jsx(R,{className:"text-muted-foreground h-4 w-4"})]}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold",children:r.total})})]}),e.jsxs(t,{children:[e.jsxs(o,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(i,{className:"text-sm font-medium",children:s.published}),e.jsx(S,{className:"h-4 w-4 text-green-600"})]}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:r.published})})]}),e.jsxs(t,{children:[e.jsxs(o,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(i,{className:"text-sm font-medium",children:s.draft}),e.jsx(v,{className:"h-4 w-4 text-yellow-600"})]}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-yellow-600",children:r.draft})})]}),e.jsxs(t,{children:[e.jsxs(o,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(i,{className:"text-sm font-medium",children:s.archived}),e.jsx(M,{className:"h-4 w-4 text-gray-600"})]}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-gray-600",children:r.archived})})]})]}),e.jsxs(t,{children:[e.jsx(H,{data:c,title:s.blog,globalSearch:!0,tablePageSizes:[10,15,20,25],routeName:"blogs.index"}),e.jsxs(L,{className:"border-border border-y",children:[e.jsx(E,{table:l}),e.jsx(k,{children:(x=l.getRowModel().rows)!=null&&x.length?l.getRowModel().rows.map(m=>e.jsx(p,{"data-state":m.getIsSelected()&&"selected",children:m.getVisibleCells().map(n=>e.jsx(h,{children:_(n.column.columnDef.cell,n.getContext())},n.id))},m.id)):e.jsx(p,{children:e.jsx(h,{colSpan:l.getAllColumns().length,className:"h-24 text-center",children:b.no_results})})})]}),e.jsx(D,{className:"p-5 sm:p-7",routeName:"blogs.index",paginationInfo:c})]})]})]})};q.layout=a=>e.jsx(A,{children:a});export{q as default};
