import{jsxs as r,jsx as e,Fragment as g}from"react/jsx-runtime";import{c as a}from"./ui-components-B24mpb8o.js";import{usePage as f,Link as m}from"@inertiajs/react";import{CircleCheck as l,Circle as w,CirclePlay as N,CirclePause as _,Lock as d,FileQuestion as b}from"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 p=({quiz:t})=>r("div",{className:"flex items-center gap-2",children:[e("div",{className:"bg-secondary flex h-6 w-6 items-center justify-center rounded-full",children:e(b,{className:"h-4 w-4"})}),e("p",{children:t.title})]}),te=({quiz:t,completed:h})=>{const{props:u}=f(),{course:y,watchHistory:i}=u,x=!!y.drip_content,s=h.some(c=>c.type==="quiz"&&c.id==t.id),o=i.current_watching_type==="quiz"&&i.current_watching_id==t.id,n=i.next_watching_type==="quiz"&&t.id==i.next_watching_id;return x?e(g,{children:s||o||n?r("div",{className:"flex items-center justify-between gap-3 rounded-sm border p-2 py-2 md:gap-3",children:[r(m,{className:a("flex cursor-pointer items-center gap-3 py-1",s?"text-blue-500":o?"text-green-500":n?"text-primary":"text-gray-500"),href:route("course.player",{type:"quiz",watch_history:i.id,lesson_id:t.id}),children:[s?e(l,{className:"h-4 w-4"}):o?e(N,{className:"h-4 w-4"}):n?e(_,{className:"h-4 w-4"}):e(d,{className:"h-4 w-4"}),e(p,{quiz:t})]}),e("span",{children:t.duration})]}):r("div",{className:"flex items-center justify-between gap-3 rounded-sm border p-2 py-2 md:gap-3",children:[r("div",{className:"flex items-center gap-3 py-1 text-gray-500",children:[e(d,{className:"h-4 w-4"}),e(p,{quiz:t})]}),e("span",{children:t.duration})]})}):r("div",{className:"flex items-center justify-between gap-3 rounded-sm border p-2 py-2 md:gap-3",children:[r(m,{className:a("flex cursor-pointer items-center gap-3 py-1",s?"text-blue-500":o?"text-green-500":"text-primary"),href:route("course.player",{type:"quiz",watch_history:i.id,lesson_id:t.id}),children:[s?e(l,{className:"h-4 w-4"}):e(w,{className:"h-4 w-4"}),e(p,{quiz:t})]}),e("span",{children:t.duration})]})};export{te as default};
