import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { getCompletedContents } from '@/lib/utils'; import { StudentCourseProps } from '@/types/page'; import { usePage } from '@inertiajs/react'; import Lesson from '../partials/lesson'; import Quiz from '../partials/quiz'; const Modules = () => { const { props } = usePage(); const { modules, watchHistory } = props; const completed = getCompletedContents(watchHistory); // const completion = getCourseCompletion(props.course, completed); return ( <> {modules.length > 0 ? ( {modules.map((section, ind) => ( {ind + 1}. {section.title} {section.section_lessons.length > 0 ? ( <> {section.section_lessons.map((lesson) => ( ))} {section.section_quizzes.map((quiz) => ( ))} ) : (

There is no lesson added

)}
))}
) : (

There is no section added

)} ); }; export default Modules;