import{aT as h,j as t,aS as p}from"./react-vendor-xYZnmIII.js";import{L as c}from"./lesson-icons-DmUU9hn_.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 o=({lesson:e,children:n})=>t.jsxs("div",{className:"relative flex items-center justify-between rounded-sm border p-2 md:gap-3",children:[n,["video","video_url"].includes(e.lesson_type)&&t.jsx("span",{className:"absolute top-0.5 right-1 text-xs md:relative md:text-sm",children:e.duration})]}),w=({lesson:e,completed:n})=>{const{props:l}=h(),{course:m,watchHistory:i}=l,u=!!m.drip_content,a=e.id==i.next_watching_id,r=n.some(d=>d.type==="lesson"&&d.id==e.id),s=i.current_watching_id==e.id;return u?t.jsx(t.Fragment,{children:r||s||a?t.jsx(o,{lesson:e,children:t.jsxs(p,{className:x("flex cursor-pointer items-center gap-3 py-1",r?"text-blue-500":s?"text-green-500":a?"text-primary":"text-gray-500"),href:route("course.player",{type:"lesson",watch_history:i.id,lesson_id:e.id}),children:[t.jsx(c,{type:"active",lesson:e,dripContent:!1,isCompleted:r,isCurrentLesson:s,isNext:a}),t.jsx("p",{children:e.title})]})}):t.jsx(o,{lesson:e,children:t.jsxs("div",{className:"flex items-center gap-3 py-1 text-gray-500",children:[t.jsx(c,{type:"inactive",lesson:e,dripContent:!0,isCompleted:r}),t.jsx("p",{children:e.title})]})})}):t.jsx(o,{lesson:e,children:t.jsxs(p,{className:x("flex cursor-pointer items-center gap-3 py-1",r?"text-blue-500":s?"text-green-500":"text-primary"),href:route("course.player",{type:"lesson",watch_history:i.id,lesson_id:e.id}),children:[t.jsx(c,{type:"active",lesson:e,dripContent:!0,isCompleted:r}),t.jsx("p",{children:e.title})]})})};export{w as default};
