import{u,r as w,bV as N,j as e,H as y,L as C,bm as T,bW as R,b8 as v,x as S,bX as M,bY as _,bZ as B,b_ as F,b$ as H}from"./vendor-BKmmeuxg.js";import{T as P}from"./table-filter-D1fnjeZE.js";import{T as D}from"./table-footer-B-sB7gNG.js";import{T as E}from"./table-header-DVkEnG6Y.js";import{B as I}from"./button-BpNwv2aE.js";import{C as t,a as o,c as i,b as d}from"./card-D9_SJYq6.js";import{T as L,a as k,b as p,c as h}from"./table-DWOXv4Pu.js";import{D as A}from"./layout-DkwBWm5d.js";import V from"./table-columns-BH-gMlFw.js";import"./use-lang-YfV87_zl.js";import"./debounce-CWHP_ANh.js";import"./route-B4ZMN77y.js";import"./utils-DxSsnXxD.js";import"./dropdown-menu-DO-po5c1.js";import"./scroll-area-C8HGru-R.js";import"./table-page-size-OCfjNXER.js";import"./index-WW_1X1qx.js";import"./sidebar-BYcYxQeZ.js";import"./separator-_3LZ_wAA.js";import"./sheet-DSvHVmaW.js";import"./tooltip-BsX7Z6vz.js";import"./main-_V386djS.js";import"./index-D9-QKOod.js";import"./appearance-D2z3xcjR.js";import"./app-BytVvUs_.js";/* empty css            */import"./language-BFZ7KItL.js";import"./notification-CYMPYbAP.js";import"./popover-B4kBsMuI.js";import"./app-logo-CmnEIwal.js";import"./accordion-CNBvFN43.js";import"./avatar-j28afJTV.js";import"./delete-modal-D1GJlb1P.js";import"./dialog-B2gN9MvT.js";const q=()=>{var x;const{props:a}=u(),{blogs:m,statistics:r,translate:b}=a,{dashboard:s,frontend:j}=b,[f,g]=w.useState([]),l=N({data:m.data,columns:V(a.translate),onSortingChange:g,getCoreRowModel:H(),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(v,{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(S,{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(P,{data:m,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(n=>e.jsx(p,{"data-state":n.getIsSelected()&&"selected",children:n.getVisibleCells().map(c=>e.jsx(h,{children:_(c.column.columnDef.cell,c.getContext())},c.id))},n.id)):e.jsx(p,{children:e.jsx(h,{colSpan:l.getAllColumns().length,className:"h-24 text-center",children:j.no_results})})})]}),e.jsx(D,{className:"p-5 sm:p-7",routeName:"blogs.index",paginationInfo:m})]})]})]})};q.layout=a=>e.jsx(A,{children:a});export{q as default};
