import{u,j as e,L as l,n as d,a8 as y,b3 as g,b4 as f,b5 as o,b6 as w}from"./vendor-BKmmeuxg.js";import{c as x}from"./utils-DxSsnXxD.js";const c=({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})]}),b=({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,n=t.next_watching_type==="quiz"&&s.id==t.next_watching_id;return j?e.jsx(e.Fragment,{children:r||a||n?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":n?"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"}):n?e.jsx(f,{className:"h-4 w-4"}):e.jsx(o,{className:"h-4 w-4"}),e.jsx(c,{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(c,{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(c,{quiz:s})]}),e.jsx("span",{children:s.duration})]})};export{b as default};
