This commit is contained in:
ditiqi 2025-02-21 17:41:12 +08:00
parent c6213cdb37
commit 6ace9b06a4
1 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import { LectureItem } from "./LectureItem";
// components/CourseSyllabus/SectionItem.tsx // components/CourseSyllabus/SectionItem.tsx
interface SectionItemProps { interface SectionItemProps {
section: SectionDto; section: SectionDto;
index?: number;
isExpanded: boolean; isExpanded: boolean;
onToggle: (sectionId: string) => void; onToggle: (sectionId: string) => void;
onLectureClick: (lectureId: string) => void; onLectureClick: (lectureId: string) => void;
@ -14,7 +15,7 @@ interface SectionItemProps {
} }
export const SectionItem = React.forwardRef<HTMLDivElement, SectionItemProps>( export const SectionItem = React.forwardRef<HTMLDivElement, SectionItemProps>(
({ section, isExpanded, onToggle, onLectureClick }, ref) => ( ({ section, index, isExpanded, onToggle, onLectureClick }, ref) => (
<motion.div <motion.div
ref={ref} ref={ref}
initial={{ opacity: 0, y: 20 }} initial={{ opacity: 0, y: 20 }}
@ -26,9 +27,9 @@ export const SectionItem = React.forwardRef<HTMLDivElement, SectionItemProps>(
onClick={() => onToggle(section.id)}> onClick={() => onToggle(section.id)}>
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">
<span className="text-lg font-medium text-gray-700"> <span className="text-lg font-medium text-gray-700">
{Math.floor(section.order)} {index}
</span> </span>
<div> <div className="flex flex-col items-start">
<h3 className="text-left font-medium text-gray-900"> <h3 className="text-left font-medium text-gray-900">
{section.title} {section.title}
</h3> </h3>