import React, { ReactNode, useEffect, useRef, useState } from 'react'; interface PanelContainerProps { title: string; children: ReactNode; description: string; panelNumber: number; } const PanelContainer: React.FC = ({ title, children, description, panelNumber }) => { const [isVisible, setIsVisible] = useState(false); const panelRef = useRef(null); useEffect(() => { const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { setIsVisible(true); } }, { root: null, rootMargin: '0px', threshold: 0.3, } ); if (panelRef.current) { observer.observe(panelRef.current); } return () => { if (panelRef.current) { observer.unobserve(panelRef.current); } }; }, []); return (
{panelNumber}

{title}

{description}

{children}
); }; export default PanelContainer;