From f363117c1dbfb67c9f5e7993a0297bc92211381e Mon Sep 17 00:00:00 2001 From: ditiqi Date: Thu, 6 Feb 2025 19:23:45 +0800 Subject: [PATCH] add --- .../course/editor/layout/CourseEditorSidebar.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/models/course/editor/layout/CourseEditorSidebar.tsx b/apps/web/src/components/models/course/editor/layout/CourseEditorSidebar.tsx index ded92b0..2c23177 100644 --- a/apps/web/src/components/models/course/editor/layout/CourseEditorSidebar.tsx +++ b/apps/web/src/components/models/course/editor/layout/CourseEditorSidebar.tsx @@ -1,12 +1,16 @@ import { motion } from "framer-motion"; import { NavItem } from "@nice/client"; +import { useCourseEditor } from "../context/CourseEditorContext"; interface CourseSidebarProps { id?: string | undefined; isHovered: boolean; setIsHovered: (value: boolean) => void; - navItems: NavItem[]; + navItems: (NavItem & { isInitialized?: boolean; isCompleted?: boolean })[]; selectedSection: number; - onNavigate: (item: NavItem, index: number) => void; + onNavigate: ( + item: NavItem & { isInitialized?: boolean; isCompleted?: boolean }, + index: number + ) => void; } export default function CourseEditorSidebar({ @@ -16,6 +20,7 @@ export default function CourseEditorSidebar({ selectedSection, onNavigate, }: CourseSidebarProps) { + const { editId } = useCourseEditor(); return ( { e.preventDefault(); onNavigate(item, index);