import{aT as u,j as e,aS as l,b8 as d,y,cx as g,cy as f,cz as o,cA as w}from"./react-vendor-xYZnmIII.js";import{c as x}from"./ui-components-CQM92IK3.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";const n=({quiz:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"bg-secondary flex h-6 w-6 items-center justify-center rounded-full",children:e.jsx(w,{className:"h-4 w-4"})}),e.jsx("p",{children:s.title})]}),k=({quiz:s,completed:p})=>{const{props:m}=u(),{course:h,watchHistory:t}=m,j=!!h.drip_content,r=p.some(i=>i.type==="quiz"&&i.id==s.id),a=t.current_watching_type==="quiz"&&t.current_watching_id==s.id,c=t.next_watching_type==="quiz"&&s.id==t.next_watching_id;return j?e.jsx(e.Fragment,{children:r||a||c?e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-sm border p-2 py-2 md:gap-3",children:[e.jsxs(l,{className:x("flex cursor-pointer items-center gap-3 py-1",r?"text-blue-500":a?"text-green-500":c?"text-primary":"text-gray-500"),href:route("course.player",{type:"quiz",watch_history:t.id,lesson_id:s.id}),children:[r?e.jsx(d,{className:"h-4 w-4"}):a?e.jsx(g,{className:"h-4 w-4"}):c?e.jsx(f,{className:"h-4 w-4"}):e.jsx(o,{className:"h-4 w-4"}),e.jsx(n,{quiz:s})]}),e.jsx("span",{children:s.duration})]}):e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-sm border p-2 py-2 md:gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 py-1 text-gray-500",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx(n,{quiz:s})]}),e.jsx("span",{children:s.duration})]})}):e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-sm border p-2 py-2 md:gap-3",children:[e.jsxs(l,{className:x("flex cursor-pointer items-center gap-3 py-1",r?"text-blue-500":a?"text-green-500":"text-primary"),href:route("course.player",{type:"quiz",watch_history:t.id,lesson_id:s.id}),children:[r?e.jsx(d,{className:"h-4 w-4"}):e.jsx(y,{className:"h-4 w-4"}),e.jsx(n,{quiz:s})]}),e.jsx("span",{children:s.duration})]})};export{k as default};
