import * as React from 'react'; import styles from '@patternfly/react-styles/css/components/Menu/menu'; import { css } from '@patternfly/react-styles'; export interface MenuGroupProps extends Omit, 'label'> { /** Items within group */ children?: React.ReactNode; /** Additional classes added to the MenuGroup */ className?: string; /** Group label */ label?: React.ReactNode; /** ID for title label */ titleId?: string; /** @hide Forwarded ref */ innerRef?: React.Ref; /** Group label heading level. Default is h1. */ labelHeadingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; } const MenuGroupBase: React.FunctionComponent = ({ children, className = '', label = '', titleId, innerRef, labelHeadingLevel: HeadingLevel = 'h1', ...props }: MenuGroupProps) => { const Wrapper = typeof label === 'function' ? label : HeadingLevel; return (
<> {['function', 'string'].includes(typeof label) ? ( {label} ) : ( label )} {children}
); }; export const MenuGroup = React.forwardRef((props: MenuGroupProps, ref: React.Ref) => ( )); MenuGroup.displayName = 'MenuGroup';