diff --git a/src/components/Course/Chapter.tsx b/src/components/Course/Chapter.tsx index 7acd99870..cfad8144c 100644 --- a/src/components/Course/Chapter.tsx +++ b/src/components/Course/Chapter.tsx @@ -7,6 +7,12 @@ import { CheckIcon } from '../ReactIcons/CheckIcon'; import { getPercentage } from '../../helper/number'; import { useIsMounted } from '../../hooks/use-is-mounted'; +function LeftBorder() { + return ( + + ); +} + type ChapterProps = ChapterFileType & { index: number; isActive?: boolean; @@ -76,31 +82,33 @@ export function Chapter(props: ChapterProps) {
{isActive && ( -
+
{lessons.length > 0 && ( <>
-
- {lessons.map((lesson) => { + {lessons.map((lesson, counter) => { const isActive = activeLessonId === lesson.id && chapterId === activeChapterId; const isCompleted = completedLessonSet.has(`${chapterId}/${lesson.id}`); return ( -
- {isCompleted && } - {isLoading && isMounted && ( - +
+ {counter}
- {title} + {title} + + {isCompleted && ( +
+ +
+ )} - + {!isActive && } ); } diff --git a/src/components/Course/CourseLayout.tsx b/src/components/Course/CourseLayout.tsx index b95e55695..00413614f 100644 --- a/src/components/Course/CourseLayout.tsx +++ b/src/components/Course/CourseLayout.tsx @@ -1,6 +1,6 @@ import { ChevronLeft, ChevronRight, Loader2 } from 'lucide-react'; import { CourseSidebar, type CourseSidebarProps } from './CourseSidebar'; -import { useEffect, useMemo, useState } from 'react'; +import {type ReactNode, useEffect, useMemo, useState} from 'react'; import { useCompleteLessonMutation, useCourseProgress, @@ -14,7 +14,7 @@ import { CourseNotes } from '../CourseNotes/CourseNotes'; import { CourseAI } from '../CourseAI/CourseAI'; export type CourseLayoutProps = { - children: React.ReactNode; + children: ReactNode; } & Omit; export function CourseLayout(props: CourseLayoutProps) { @@ -123,7 +123,7 @@ export function CourseLayout(props: CourseLayoutProps) {
-
-

{title}

- -
- {completedPercentage}% Completed -
-
-
+