import { ComponentProps } from 'react'; import TapArea from '../TapArea'; import TapAreaLink from '../TapAreaLink'; type Props = Pick< ComponentProps, 'accessibilityControls' | 'accessibilityExpanded' | 'tapStyle' > & { accessibilityCurrent?: ComponentProps['accessibilityCurrent']; children: JSX.Element; href?: string; isExpandable: boolean | undefined; onLinkClick?: ComponentProps['onTap']; onTap: () => void; onBlur: () => void; onFocus: () => void; onMouseEnter: () => void; onMouseLeave: () => void; }; export default function SideNavigationGroupItemTapControl({ accessibilityControls, accessibilityCurrent, accessibilityExpanded, children, onLinkClick, onTap, href, isExpandable, tapStyle, onBlur, onFocus, onMouseEnter, onMouseLeave, }: Props) { if (href) { return ( { onLinkClick?.(e); onTap?.(); }} rounding={2} tapStyle={tapStyle} > {children} ); } if (isExpandable) { return ( {children} ); } return children; }