import { ChevronDownIcon, ClockIcon, PlayCircleIcon } from '@heroicons/react/24/outline' import { useState } from 'react' import { Section, SectionDto } from "@nice/common" interface CourseSyllabusProps { sections: SectionDto[] onLectureClick?: (lectureId: string) => void } export const CourseSyllabus: React.FC = ({ sections, onLectureClick }) => { const [expandedSections, setExpandedSections] = useState([]) const toggleSection = (sectionId: string) => { setExpandedSections(prev => prev.includes(sectionId) ? prev.filter(id => id !== sectionId) : [...prev, sectionId] ) } return (
{sections.map((section) => (
{/* 章节标题 */} {/* 课时列表 */} {expandedSections.includes(section.id) && (
{section.lectures.map((lecture) => ( ))}
)}
))}
) }