import { useState, useEffect } from 'react'; import { Accordion, AccordionSummary, AccordionDetails } from '@mui/material'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { guideSections } from './guideTypes'; interface GuideTableOfContentsProps { activeSection: string; } export const GuideTableOfContents = ({ activeSection }: GuideTableOfContentsProps) => { const [isMobile, setIsMobile] = useState(false); const [tocExpanded, setTocExpanded] = useState(false); useEffect(() => { const check = () => setIsMobile(window.innerWidth < 768); check(); window.addEventListener('resize', check); return () => window.removeEventListener('resize', check); }, []); const handleClick = (sectionId: string) => { const element = document.getElementById(sectionId); if (element) { element.scrollIntoView({ behavior: 'smooth', block: 'start' }); } if (isMobile) { setTocExpanded(false); } }; const tocContent = ( ); if (isMobile) { return (