import{u as b,j as e,H as v,e as w,bl as y,bm as u,bn as f,b3 as C,b4 as _,D as g,x as D,T as P}from"./vendor-BKmmeuxg.js";import{D as B}from"./data-sort-modal-B2Yf_crJ.js";import{D as S}from"./delete-modal-D1GJlb1P.js";import{B as F}from"./badge-AQfLLMpR.js";import{B as i}from"./button-BpNwv2aE.js";import{C as r,a as l,c as o,b as c}from"./card-D9_SJYq6.js";import{D as H}from"./layout-DkwBWm5d.js";import j from"./category-form-BqEOwxwO.js";import"./utils-DxSsnXxD.js";import"./dialog-B2gN9MvT.js";import"./scroll-area-C8HGru-R.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"./dropdown-menu-DO-po5c1.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"./route-B4ZMN77y.js";import"./avatar-j28afJTV.js";import"./use-lang-YfV87_zl.js";import"./icon-picker-iXyBXP6r.js";import"./debounce-CWHP_ANh.js";import"./label-HmIcv5Yx.js";import"./input-error-LaPr_4wd.js";import"./input-DM0goJrn.js";import"./select-CD9o3HN1.js";import"./textarea-CyndvowL.js";const T=()=>{const{props:n}=b(),{categories:d,statistics:m,translate:N}=n,{dashboard:t,button:x}=N,a=d.find(s=>s.slug==="default"),h=d.filter(s=>s.slug!=="default");return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:t.blog_categories}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"hidden text-xl font-semibold sm:block",children:t.blog_category}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(B,{title:t.sort_categories,data:h,handler:e.jsxs(i,{variant:"ghost",className:"bg-muted hover:bg-muted-foreground/6",children:[e.jsx(y,{})," ",x.sort_categories]}),onOrderChange:(s,p)=>{w.post(route("blogs.categories.sort"),{sortedData:s},{preserveScroll:!0,onSuccess:()=>p&&p(!1)})},renderContent:s=>e.jsx(r,{className:"w-full px-4 py-3",children:e.jsx("p",{children:s.name})})}),e.jsx(j,{title:t.create_category,handler:e.jsxs(i,{children:[e.jsx(u,{className:"h-4 w-4"}),x.create]})})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs(r,{children:[e.jsxs(l,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(o,{className:"text-sm font-medium",children:t.total_categories}),e.jsx(f,{className:"text-muted-foreground h-4 w-4"})]}),e.jsx(c,{children:e.jsx("div",{className:"text-2xl font-bold",children:m.total})})]}),e.jsxs(r,{children:[e.jsxs(l,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(o,{className:"text-sm font-medium",children:t.active}),e.jsx(C,{className:"h-4 w-4 text-green-600"})]}),e.jsx(c,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:m.active})})]}),e.jsxs(r,{children:[e.jsxs(l,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(o,{className:"text-sm font-medium",children:t.inactive}),e.jsx(_,{className:"h-4 w-4 text-red-600"})]}),e.jsx(c,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:m.inactive})})]})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[a&&e.jsxs(r,{className:"relative",children:[e.jsxs(l,{className:"pb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{name:a.icon}),e.jsx(o,{className:"text-lg",children:a.name})]}),a.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:a.description})]}),e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t.total_number_of_blog}),e.jsx("span",{className:"font-medium",children:a.blogs_count})]})})]}),h.map(s=>e.jsxs(r,{className:"relative",children:[e.jsxs(l,{className:"pb-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{name:s.icon}),e.jsx(o,{className:"text-lg",children:s.name}),e.jsx(F,{variant:s.status==="active"?"default":"destructive",children:s.status})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(j,{title:x.update,category:s,handler:e.jsx(i,{variant:"ghost",size:"icon",children:e.jsx(D,{className:"h-4 w-4"})})}),e.jsx(S,{routePath:route("blogs.categories.destroy",s.id),actionComponent:e.jsx(i,{variant:"ghost",size:"icon",children:e.jsx(P,{className:"text-destructive h-4 w-4"})})})]})]}),s.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:s.description})]}),e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t.total_number_of_blog}),e.jsx("span",{className:"font-medium",children:s.blogs_count})]})})]},s.id))]}),d.length===0&&e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(f,{className:"text-muted-foreground mx-auto h-12 w-12"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No categories found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"Get started by creating your first blog category"}),e.jsx(j,{title:"Create Category",handler:e.jsxs(i,{children:[e.jsx(u,{className:"mr-2 h-4 w-4"}),"Add New Category"]})})]})]})]})};T.layout=n=>e.jsx(H,{children:n});export{T as default};