import { MinusIcon, PlusIcon, type LucideIcon } from 'lucide-react'; import { useEffect, useState } from 'react'; import { cn } from '../../lib/classname'; type CourseFeatureProps = { title: string; icon: LucideIcon; description: string; imgUrl?: string; }; export function CourseFeature(props: CourseFeatureProps) { const { title, icon: Icon, description, imgUrl } = props; const [isExpanded, setIsExpanded] = useState(false); const [isZoomed, setIsZoomed] = useState(false); useEffect(() => { function onScroll() { if (isZoomed) { setIsZoomed(false); } } window.addEventListener('scroll', onScroll); return () => window.removeEventListener('scroll', onScroll); }, [isZoomed]); return ( <> {isZoomed && (
{description}
{imgUrl && (