import{jsxs as i,jsx as e}from"react/jsx-runtime";import{a as N,k as w,m as x,l as C,a4 as T,x as v,y as s,z as a,aD as d,aH as h,aF as t,aI as r,aE as m,aG as o,B}from"./ui-components-B24mpb8o.js";import{Trash2 as S}from"lucide-react";import{DynamicIcon as I}from"lucide-react/dynamic";import{useState as A}from"react";import H from"./api-copy-DM3xOhFq.js";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";const he=({data:n,removing:g,inserting:j,categories:V,onRemove:b,onInsert:$})=>{const[p,f]=A("best"),c=(l,u)=>i(t,{children:[e(o,{children:l.icon?e(I,{name:l.icon,className:"text-primary h-8 w-8"}):e("div",{className:"bg-muted h-12 w-12 rounded"})}),e(o,{className:"font-medium",children:l.name}),e(o,{children:l.slug||"N/A"}),i(o,{children:[l.blogs_count||0," blogs"]}),e(o,{children:e(B,{variant:"ghost",size:"icon",onClick:()=>b("blog_categories",u,l.id),disabled:g===`blog_categories-${u}-${l.id}`,children:e(S,{className:"text-destructive h-4 w-4"})})})]},l.id);return i(N,{children:[e(w,{className:"flex flex-row flex-wrap items-center justify-between gap-3",children:i("div",{children:[e(x,{className:"text-xl font-bold",children:"Blog Categories"}),e(H,{value:`api/collections/blog_categories/${p}`})]})}),e(C,{children:i(T,{defaultValue:"best",className:"w-full",value:p,onValueChange:f,children:[i(v,{className:"grid w-full grid-cols-3",children:[e(s,{value:"best",children:"Best"}),e(s,{value:"top",children:"Top"}),e(s,{value:"new",children:"New"})]}),e(a,{value:"best",children:i(d,{children:[e(h,{children:i(t,{children:[e(r,{children:"Icon"}),e(r,{children:"Name"}),e(r,{children:"Slug"}),e(r,{children:"Blogs"}),e(r,{children:"Action"})]})}),e(m,{children:n.best?c(n.best,"best"):e(t,{children:e(o,{colSpan:5,className:"text-muted-foreground text-center",children:"No best blog category selected"})})})]})}),e(a,{value:"top",children:i(d,{children:[e(h,{children:i(t,{children:[e(r,{children:"Icon"}),e(r,{children:"Name"}),e(r,{children:"Slug"}),e(r,{children:"Blogs"}),e(r,{children:"Action"})]})}),e(m,{children:n.top&&n.top.length>0?n.top.map(l=>c(l,"top")):e(t,{children:e(o,{colSpan:5,className:"text-muted-foreground text-center",children:"No top blog categories selected"})})})]})}),e(a,{value:"new",children:i(d,{children:[e(h,{children:i(t,{children:[e(r,{children:"Icon"}),e(r,{children:"Name"}),e(r,{children:"Slug"}),e(r,{children:"Blogs"}),e(r,{children:"Action"})]})}),e(m,{children:n.new&&n.new.length>0?n.new.map(l=>c(l,"new")):e(t,{children:e(o,{colSpan:5,className:"text-muted-foreground text-center",children:"No new blog categories selected"})})})]})})]})})]})};export{he as default};
