import{j as e,H as p,bm as m,D as l,c1 as h,T as j}from"./vendor-BKmmeuxg.js";import{D as u}from"./delete-modal-D1GJlb1P.js";import{B as f}from"./badge-AQfLLMpR.js";import{B as a}from"./button-BpNwv2aE.js";import{C as i,b as d}from"./card-D9_SJYq6.js";import{S as c}from"./separator-_3LZ_wAA.js";import{u as g}from"./use-auth-NG-DQJrC.js";import{D as N}from"./layout-DkwBWm5d.js";import o from"./category-form-Dv_rK8bP.js";import"./dialog-B2gN9MvT.js";import"./utils-DxSsnXxD.js";import"./index-WW_1X1qx.js";import"./sidebar-BYcYxQeZ.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"./scroll-area-C8HGru-R.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-dialog-AqyWbPod.js";import"./icon-picker-iXyBXP6r.js";import"./debounce-CWHP_ANh.js";import"./label-HmIcv5Yx.js";import"./input-DM0goJrn.js";import"./input-error-LaPr_4wd.js";import"./loading-button-BnTVAMJ7.js";import"./select-CD9o3HN1.js";import"./textarea-CyndvowL.js";import"./inertia-SZXqLvQm.js";const y=({categories:t})=>{const{isAdmin:n}=g(),r=t.find(s=>s.slug==="default"),x=t.filter(s=>s.slug!=="default");return e.jsxs(e.Fragment,{children:[e.jsx(p,{title:"Exam Categories"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Exam Categories"}),e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Manage exam categories and organize your exams"})]}),e.jsx(o,{title:"Create Category",handler:e.jsxs(a,{children:[e.jsx(m,{className:"mr-2 h-4 w-4"}),"Add Category"]})})]}),t.length>0?e.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-6 border-t border-gray-300 py-6 md:grid-cols-2 lg:grid-cols-3",children:[r&&e.jsxs(i,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(l,{size:20,name:r.icon}),e.jsx("h2",{children:r.title})]}),e.jsx(c,{className:"my-4"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"When a category is deleted, its exams are moved to the default category. The default category cannot be edited or removed."})]},r.id),x.map(s=>e.jsxs(i,{className:"p-6",children:[e.jsxs("div",{className:"relative text-center",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(l,{size:20,name:s.icon}),e.jsx("h2",{children:s.title})]}),e.jsxs("div",{className:"absolute -top-1 flex w-full items-center justify-end space-x-1",children:[e.jsx(o,{title:"Edit Category",category:s,handler:e.jsx(a,{size:"icon",variant:"ghost",className:"bg-muted hover:bg-muted-foreground/10 h-8 w-8 rounded-full p-0",children:e.jsx(h,{className:"text-sm"})})}),n&&e.jsx(u,{message:"Are you sure you want to delete this category?",routePath:route("exam-categories.destroy",s.id),actionComponent:e.jsx(a,{size:"icon",variant:"ghost",className:"bg-destructive/8 hover:bg-destructive/6 h-8 w-8 rounded-full p-0",children:e.jsx(j,{className:"text-destructive text-sm"})})})]})]}),e.jsx(c,{className:"my-4"}),e.jsxs(d,{className:"p-0",children:[e.jsx("p",{className:"mb-3 text-sm text-gray-600",children:s.description||"No description"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(f,{variant:s.status?"default":"secondary",children:s.status?"Active":"Inactive"}),e.jsxs("span",{className:"text-sm text-gray-500",children:[s.exams_count||0," exams"]})]})]})]},s.id))]}):e.jsx("div",{className:"col-span-full",children:e.jsx(i,{children:e.jsxs(d,{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("p",{className:"mb-4 text-gray-600",children:"No categories found. Create your first category!"}),e.jsx(o,{title:"Create Category",handler:e.jsxs(a,{children:[e.jsx(m,{className:"mr-2 h-4 w-4"}),"Add Category"]})})]})})})]})]})};y.layout=t=>e.jsx(N,{children:t});export{y as default};
