import React, { useState, useEffect } from 'react'; export interface ScrollspyProps { /** * An array of MenuGroup items that is used to build the menu and its links. * Each MenuGroup has an optional label and a required 'items' array of MenuItems. * Each MenuItem has a label that is rendered in the menu and a targetId that is the id of the element it should link to. * Do not include '#' in targetId. * example: [ {label: '...', items: [ {label: '...', targetId: '...'}, {label: '...', targetId: '...', items: [ {label: '...', targetId: '...'} }] ]} ] */ menuGroups: MenuGroup[]; /** * Class name applied to active links in the menu (default: 'is-active') */ activeClassName: string; /** * Class name applied to the