import{jsx as r,jsxs as p,Fragment as y}from"react/jsx-runtime";import{L as c}from"./lesson-icons-CkBBjsxb.js";import{c as a}from"./ui-components-B24mpb8o.js";import{usePage as f,Link as l}from"@inertiajs/react";import"lucide-react";import"next-themes";import"sonner";import"react";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";const d=({lesson:t,children:m})=>p("div",{className:"relative flex items-center justify-between rounded-sm border p-2 md:gap-3",children:[m,["video","video_url"].includes(t.lesson_type)&&r("span",{className:"absolute top-0.5 right-1 text-xs md:relative md:text-sm",children:t.duration})]}),Y=({lesson:t,completed:m})=>{const{props:h}=f(),{course:u,watchHistory:i}=h,x=!!u.drip_content,n=t.id==i.next_watching_id,e=m.some(s=>s.type==="lesson"&&s.id==t.id),o=i.current_watching_id==t.id;return x?r(y,{children:e||o||n?r(d,{lesson:t,children:p(l,{className:a("flex cursor-pointer items-center gap-3 py-1",e?"text-blue-500":o?"text-green-500":n?"text-primary":"text-gray-500"),href:route("course.player",{type:"lesson",watch_history:i.id,lesson_id:t.id}),children:[r(c,{type:"active",lesson:t,dripContent:!1,isCompleted:e,isCurrentLesson:o,isNext:n}),r("p",{children:t.title})]})}):r(d,{lesson:t,children:p("div",{className:"flex items-center gap-3 py-1 text-gray-500",children:[r(c,{type:"inactive",lesson:t,dripContent:!0,isCompleted:e}),r("p",{children:t.title})]})})}):r(d,{lesson:t,children:p(l,{className:a("flex cursor-pointer items-center gap-3 py-1",e?"text-blue-500":o?"text-green-500":"text-primary"),href:route("course.player",{type:"lesson",watch_history:i.id,lesson_id:t.id}),children:[r(c,{type:"active",lesson:t,dripContent:!0,isCompleted:e}),r("p",{children:t.title})]})})};export{Y as default};
