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