import{r as b,j as e,b9 as g,a$ as w}from"./react-vendor-xYZnmIII.js";import{a as T,k as f,m as N,l as C,a5 as v,y as E,z as c,D as x,aE as t,aI as d,aG as a,aJ as s,aF as o,aH as r,B as S}from"./ui-components-CQM92IK3.js";import I from"./api-copy-kRxB8Vsy.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";const F=({data:n,removing:m,inserting:A,categories:B,onRemove:u,onInsert:H})=>{const[h,p]=b.useState("best"),i=(l,j)=>e.jsxs(a,{children:[e.jsx(r,{children:l.icon?e.jsx(g,{name:l.icon,className:"text-primary h-8 w-8"}):e.jsx("div",{className:"bg-muted h-12 w-12 rounded"})}),e.jsx(r,{className:"font-medium",children:l.title}),e.jsx(r,{children:l.slug||"N/A"}),e.jsxs(r,{children:[l.exams_count||0," exams"]}),e.jsx(r,{children:e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>u("exam_categories",j,l.id),disabled:m===`exam_categories-${j}-${l.id}`,children:e.jsx(w,{className:"text-destructive h-4 w-4"})})})]},l.id);return e.jsxs(T,{children:[e.jsx(f,{className:"flex flex-row flex-wrap items-center justify-between gap-3",children:e.jsxs("div",{children:[e.jsx(N,{className:"text-xl font-bold",children:"Exam Categories"}),e.jsx(I,{value:`api/collections/exam_categories/${h}`})]})}),e.jsx(C,{children:e.jsxs(v,{defaultValue:"best",className:"w-full",value:h,onValueChange:p,children:[e.jsxs(E,{className:"grid w-full grid-cols-3",children:[e.jsx(c,{value:"best",children:"Best"}),e.jsx(c,{value:"top",children:"Top"}),e.jsx(c,{value:"new",children:"New"})]}),e.jsx(x,{value:"best",children:e.jsxs(t,{children:[e.jsx(d,{children:e.jsxs(a,{children:[e.jsx(s,{children:"Icon"}),e.jsx(s,{children:"Title"}),e.jsx(s,{children:"Slug"}),e.jsx(s,{children:"Exams"}),e.jsx(s,{children:"Action"})]})}),e.jsx(o,{children:n.best?i(n.best,"best"):e.jsx(a,{children:e.jsx(r,{colSpan:5,className:"text-muted-foreground text-center",children:"No best exam category selected"})})})]})}),e.jsx(x,{value:"top",children:e.jsxs(t,{children:[e.jsx(d,{children:e.jsxs(a,{children:[e.jsx(s,{children:"Icon"}),e.jsx(s,{children:"Title"}),e.jsx(s,{children:"Slug"}),e.jsx(s,{children:"Exams"}),e.jsx(s,{children:"Action"})]})}),e.jsx(o,{children:n.top&&n.top.length>0?n.top.map(l=>i(l,"top")):e.jsx(a,{children:e.jsx(r,{colSpan:5,className:"text-muted-foreground text-center",children:"No top exam categories selected"})})})]})}),e.jsx(x,{value:"new",children:e.jsxs(t,{children:[e.jsx(d,{children:e.jsxs(a,{children:[e.jsx(s,{children:"Icon"}),e.jsx(s,{children:"Title"}),e.jsx(s,{children:"Slug"}),e.jsx(s,{children:"Exams"}),e.jsx(s,{children:"Action"})]})}),e.jsx(o,{children:n.new&&n.new.length>0?n.new.map(l=>i(l,"new")):e.jsx(a,{children:e.jsx(r,{colSpan:5,className:"text-muted-foreground text-center",children:"No new exam categories selected"})})})]})})]})})]})};export{F as default};
