import { ComponentProps } from 'react'; import ItemContent from './ItemContent'; import { ItemIconButton } from './PrimaryActionIconButton'; import Box from '../Box'; import IconCompact from '../IconCompact'; import TapArea from '../TapArea'; type Props = { active?: ComponentProps['active']; expanded: boolean; isLink?: boolean; expandIconButtonProps?: Pick< ComponentProps, 'accessibilityControls' | 'accessibilityExpanded' | 'onTap' >; }; export default function SideNavigationGroupExpandIconButton({ expanded, active, isLink: hasLink, expandIconButtonProps, }: Props) { if (!hasLink) { return ( ); } return ( event.stopPropagation()} onTap={({ event }) => { event.preventDefault(); event.stopPropagation(); expandIconButtonProps?.onTap?.({ event }); }} /> ); }