diff --git a/src/components/SQLCourseVariant/CourseFeatures.tsx b/src/components/SQLCourseVariant/CourseFeatures.tsx index 93511ee6d..c9431d940 100644 --- a/src/components/SQLCourseVariant/CourseFeatures.tsx +++ b/src/components/SQLCourseVariant/CourseFeatures.tsx @@ -65,6 +65,8 @@ export function CourseFeatures() { }, ]; + const [expandedFeatureIndex, setExpandedFeatureIndex] = useState(0); + return (
setExpandedFeatureIndex(index)} /> ))}
@@ -87,6 +90,7 @@ export function CourseFeatures() { type CourseFeatureProps = Feature & { isExpanded?: boolean; + onExpand?: () => void; }; function CourseFeature(props: CourseFeatureProps) { @@ -95,11 +99,10 @@ function CourseFeature(props: CourseFeatureProps) { description, icon: Icon, imgUrl, - isExpanded: isDefaultExpanded = false, + isExpanded, + onExpand, } = props; - const [isExpanded, setIsExpanded] = useState(isDefaultExpanded); - return (
- + + )}
{isExpanded && (