import{u,j as e,L as l,m as d,a9 as y,b$ as g,c0 as f,c1 as o,c2 as w}from"./vendor-rThclpOQ.js";import{c as x}from"./utils-8KAaAB9H.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})]}),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,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{b as default};
