import { ComponentProps } from 'react'; import classNames from 'classnames'; import styles from './TableOfContentsAnchor.css'; import Box from '../Box'; import { useNesting } from '../contexts/NestingProvider'; import Flex from '../Flex'; import TapAreaLink from '../TapAreaLink'; import Text from '../Text'; import useInteractiveStates from '../utils/useInteractiveStates'; type Props = { label: string; href: string; active: boolean; onClick?: ComponentProps['onTap']; }; export default function TableOfContentsAnchor({ label, active, href, onClick }: Props) { const { nestedLevel } = useNesting(); const { handleOnFocus, handleOnBlur, handleOnMouseEnter, handleOnMouseLeave, isHovered } = useInteractiveStates(); const hasMarker = active || isHovered; const markerColor = active ? 'inverse' : 'tertiary'; const nestingFontSize = nestedLevel === 1 ? '300' : '200'; return (
{label}
); }