parent
088d4e2e2d
commit
0abddab414
9 changed files with 171 additions and 222 deletions
@ -1,46 +1,17 @@ |
||||
import { useState, type ReactNode } from 'react'; |
||||
import { CourseSidebar } from './CourseSidebar'; |
||||
import { CourseLayout } from './CourseLayout'; |
||||
import { Circle, CircleCheck, CircleX } from 'lucide-react'; |
||||
import { cn } from '../../lib/classname'; |
||||
import type { |
||||
ChapterFileType, |
||||
CourseFileType, |
||||
LessonFileType, |
||||
} from '../../lib/course'; |
||||
import { type ReactNode } from 'react'; |
||||
|
||||
type LessonViewProps = { |
||||
courseId: string; |
||||
chapterId: string; |
||||
lessonId: string; |
||||
|
||||
title: string; |
||||
course: CourseFileType & { |
||||
chapters: ChapterFileType[]; |
||||
}; |
||||
lesson: LessonFileType; |
||||
children: ReactNode; |
||||
}; |
||||
|
||||
export function LessonView(props: LessonViewProps) { |
||||
const { children, title, course, lesson, courseId, chapterId } = props; |
||||
const { chapters } = course; |
||||
const { children } = props; |
||||
|
||||
return ( |
||||
<CourseLayout |
||||
courseId={courseId} |
||||
chapterId={chapterId} |
||||
lessonId={lesson.id} |
||||
lesson={lesson} |
||||
title={title} |
||||
chapters={chapters} |
||||
completedPercentage={0} |
||||
> |
||||
<div className="relative h-full"> |
||||
<div className="absolute inset-0 overflow-y-auto [scrollbar-color:#3f3f46_#27272a;]"> |
||||
<div className="mx-auto max-w-xl p-4">{children}</div> |
||||
</div> |
||||
</div> |
||||
</CourseLayout> |
||||
); |
||||
} |
||||
|
@ -0,0 +1,11 @@ |
||||
import { QueryCache, QueryClient } from '@tanstack/react-query'; |
||||
|
||||
export const queryClient = new QueryClient({ |
||||
queryCache: new QueryCache({}), |
||||
defaultOptions: { |
||||
queries: { |
||||
retry: false, |
||||
enabled: !import.meta.env.SSR, |
||||
}, |
||||
}, |
||||
}); |
Loading…
Reference in new issue