| 1 |
import { css } from '@patternfly/react-styles'; |
| 2 |
import { MenuGroupProps, MenuGroup } from '../Menu'; |
| 3 |
|
| 4 |
/** |
| 5 |
* See the MenuGroup section of the Menu documentation for additional props that may be passed. |
| 6 |
*/ |
| 7 |
export interface SelectGroupProps extends Omit<MenuGroupProps, 'ref'> { |
| 8 |
/** Anything which can be rendered in a select group */ |
| 9 |
children: React.ReactNode; |
| 10 |
/** Classes applied to root element of select group */ |
| 11 |
className?: string; |
| 12 |
/** Label of the select group */ |
| 13 |
label?: React.ReactNode; |
| 14 |
} |
| 15 |
|
| 16 |
export const SelectGroup: React.FunctionComponent<SelectGroupProps> = ({ |
| 17 |
children, |
| 18 |
className, |
| 19 |
label, |
| 20 |
...props |
| 21 |
}: SelectGroupProps) => ( |
| 22 |
<MenuGroup className={css(className)} label={label} {...props}> |
| 23 |
{children} |
| 24 |
</MenuGroup> |
| 25 |
); |
| 26 |
SelectGroup.displayName = 'SelectGroup'; |