import { ReactNode } from 'react'; import classNames from 'classnames'; import boxWhitespace from './boxWhitespace.css'; import ListStyles from './List.css'; import TableOfContentsAnchor from './TableOfContents/TableOfContentsAnchor'; import TableOfContentsItemList from './TableOfContents/TableOfContentsItemList'; type Props = { /** * Label for the item. */ label: string; /** * Directs users to the url when item is selected. */ href: string; /** * When set to `true`, it displays the item in "active" state. */ active: boolean; /** * Callback when the user selects an item using the mouse or keyboard. */ onClick?: (arg1: { event: React.MouseEvent | React.KeyboardEvent; dangerouslyDisableOnNavigation: () => void; }) => void; /** * Must be instances TableofContents.Item */ children?: ReactNode; }; /** * [TableOfContents.Item](https://gestalt.pinterest.systems/web/tableofcontents#TableOfContents.Item) is a subcomponent of [TableOfContents](https://gestalt.pinterest.systems/web/tableofcontents). Use [TableOfContents.Item](https://gestalt.pinterest.systems/web/tableofcontents#TableOfContents.Item) to redirect the user to a different section of a page. */ export default function TableOfContentsItem(props: Props) { return (
  • {props.children ? {props.children} : null}
  • ); } TableOfContentsItem.displayName = 'TableOfContents.Item';