(sectionId: string, event: React.MouseEvent)
| 52 | ); |
| 53 | |
| 54 | const toggleSection = (sectionId: string, event: React.MouseEvent) => { |
| 55 | event.stopPropagation(); |
| 56 | setExpandedSections(prev => { |
| 57 | const newSet = new Set(prev); |
| 58 | if (newSet.has(sectionId)) { |
| 59 | newSet.delete(sectionId); |
| 60 | } else { |
| 61 | newSet.add(sectionId); |
| 62 | } |
| 63 | return newSet; |
| 64 | }); |
| 65 | }; |
| 66 | |
| 67 | const renderSection = (sectionId: string, level = 0) => { |
| 68 | const section = wikiStructure.sections.find(s => s.id === sectionId); |