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