add
This commit is contained in:
parent
c6213cdb37
commit
6ace9b06a4
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue