import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Dialog, DialogContent, DialogTrigger } from '@/components/ui/dialog'; import VideoPlayer from '@/components/video-player'; import { getPageSection } from '@/lib/page'; import { IntroPageProps } from '@/types/page'; import { usePage } from '@inertiajs/react'; import { File, FileQuestion, FileText, Image, Play, Video } from 'lucide-react'; import Section from '../section'; const TopCourse = () => { const { props } = usePage(); const { page, topCourse, customize } = props; const topCourseSection = getPageSection(page, 'top_course'); const videoTypes = ['video', 'video_url']; return (
{topCourse ? (
{topCourse.preview && ( )}
{topCourse.title}
0 ? (topCourse.sections[0].id as string) : ''} > {topCourse.sections.map((section, index) => ( Module {index + 1}: {section.title} {section.section_lessons.length > 0 ? ( <> {section.section_lessons.map((lesson) => (
{videoTypes.includes(lesson.lesson_type) &&

{lesson.title}

{videoTypes.includes(lesson.lesson_type) && {lesson.duration}}
))} {section.section_quizzes.map((quiz) => (

{quiz.title}

{quiz.duration}
))} ) : (

There is no lesson added

)}
))}
) : (

Top Course Sections. There is no course added.

)}
); }; export default TopCourse;