lms/public/build/assets/lesson-CdmzyD25.js
2025-12-15 12:26:23 +01:00

2 lines
1.6 KiB
JavaScript

import{u as h,j as t,L as p}from"./vendor-BKmmeuxg.js";import{L as a}from"./lesson-icons-B8irG92C.js";import{c as x}from"./utils-DxSsnXxD.js";const d=({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})]}),g=({lesson:e,completed:n})=>{const{props:l}=h(),{course:m,watchHistory:i}=l,u=!!m.drip_content,c=e.id==i.next_watching_id,r=n.some(o=>o.type==="lesson"&&o.id==e.id),s=i.current_watching_id==e.id;return u?t.jsx(t.Fragment,{children:r||s||c?t.jsx(d,{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":c?"text-primary":"text-gray-500"),href:route("course.player",{type:"lesson",watch_history:i.id,lesson_id:e.id}),children:[t.jsx(a,{type:"active",lesson:e,dripContent:!1,isCompleted:r,isCurrentLesson:s,isNext:c}),t.jsx("p",{children:e.title})]})}):t.jsx(d,{lesson:e,children:t.jsxs("div",{className:"flex items-center gap-3 py-1 text-gray-500",children:[t.jsx(a,{type:"inactive",lesson:e,dripContent:!0,isCompleted:r}),t.jsx("p",{children:e.title})]})})}):t.jsx(d,{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(a,{type:"active",lesson:e,dripContent:!0,isCompleted:r}),t.jsx("p",{children:e.title})]})})};export{g as default};