import{jsxs as l,jsx as e}from"react/jsx-runtime";import{a as T,k as N,m as g,l as C,a4 as v,x as j,y as c,z as d,aD as a,aH as h,aF as o,aI as r,aE as m,aG as n,B as A}from"./ui-components-B24mpb8o.js";import{Trash2 as I}from"lucide-react";import{useState as B}from"react";import E 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 ae=({data:t,removing:x,inserting:H,exams:S,onRemove:f,onInsert:q})=>{const[p,w]=B("best"),s=(i,u)=>{var b;return l(o,{children:[e(n,{children:e("img",{src:i.thumbnail||"/placeholder.jpg",alt:i.title,className:"h-12 w-20 rounded object-cover"})}),e(n,{className:"font-medium",children:i.title}),e(n,{children:((b=i.course)==null?void 0:b.title)||"N/A"}),l(n,{children:[i.quiz_questions_count||0," questions"]}),e(n,{children:e(A,{variant:"ghost",size:"icon",onClick:()=>f("exams",u,i.id),disabled:x===`exams-${u}-${i.id}`,children:e(I,{className:"text-destructive h-4 w-4"})})})]},i.id)};return l(T,{children:[e(N,{className:"flex flex-row flex-wrap items-center justify-between gap-3",children:l("div",{children:[e(g,{className:"text-xl font-bold",children:"Exams"}),e(E,{value:`api/collections/exams/${p}`})]})}),e(C,{children:l(v,{defaultValue:"best",className:"w-full",value:p,onValueChange:w,children:[l(j,{className:"grid w-full grid-cols-3",children:[e(c,{value:"best",children:"Best"}),e(c,{value:"top",children:"Top"}),e(c,{value:"new",children:"New"})]}),e(d,{value:"best",children:l(a,{children:[e(h,{children:l(o,{children:[e(r,{children:"Icon"}),e(r,{children:"Title"}),e(r,{children:"Course"}),e(r,{children:"Questions"}),e(r,{children:"Action"})]})}),e(m,{children:t.best?s(t.best,"best"):e(o,{children:e(n,{colSpan:5,className:"text-muted-foreground text-center",children:"No best exam selected"})})})]})}),e(d,{value:"top",children:l(a,{children:[e(h,{children:l(o,{children:[e(r,{children:"Icon"}),e(r,{children:"Title"}),e(r,{children:"Course"}),e(r,{children:"Questions"}),e(r,{children:"Action"})]})}),e(m,{children:t.top&&t.top.length>0?t.top.map(i=>s(i,"top")):e(o,{children:e(n,{colSpan:5,className:"text-muted-foreground text-center",children:"No top exams selected"})})})]})}),e(d,{value:"new",children:l(a,{children:[e(h,{children:l(o,{children:[e(r,{children:"Icon"}),e(r,{children:"Title"}),e(r,{children:"Course"}),e(r,{children:"Questions"}),e(r,{children:"Action"})]})}),e(m,{children:t.new&&t.new.length>0?t.new.map(i=>s(i,"new")):e(o,{children:e(n,{colSpan:5,className:"text-muted-foreground text-center",children:"No new exams selected"})})})]})})]})})]})};export{ae as default};
