diff --git a/src/components/Course/Chapter.tsx b/src/components/Course/Chapter.tsx index 0a1decb40..756283d86 100644 --- a/src/components/Course/Chapter.tsx +++ b/src/components/Course/Chapter.tsx @@ -11,10 +11,19 @@ type ChapterProps = ChapterFileType & { index: number; isActive?: boolean; isCompleted?: boolean; + + onChapterClick?: () => void; }; export function Chapter(props: ChapterProps) { - const { index, frontmatter, lessons, exercises, isActive = false } = props; + const { + index, + frontmatter, + lessons, + exercises, + isActive = false, + onChapterClick, + } = props; const { title } = frontmatter; return ( @@ -24,6 +33,7 @@ export function Chapter(props: ChapterProps) { 'flex w-full items-center gap-2 border-b border-zinc-800 p-2 text-sm', isActive && 'bg-zinc-300 text-zinc-900', )} + onClick={onChapterClick} >