| 1 |
import styles from '@patternfly/react-styles/css/components/Panel/panel'; |
| 2 |
import { css } from '@patternfly/react-styles'; |
| 3 |
import cssMaxHeight from '@patternfly/react-tokens/dist/esm/c_panel__main_MaxHeight'; |
| 4 |
|
| 5 |
export interface PanelMainProps extends React.HTMLProps<HTMLDivElement> { |
| 6 |
/** Content rendered inside the panel main div */ |
| 7 |
children?: React.ReactNode; |
| 8 |
/** Class to add to outer div */ |
| 9 |
className?: string; |
| 10 |
/** Max height of the panel main div as a string with the value and unit */ |
| 11 |
maxHeight?: string; |
| 12 |
} |
| 13 |
|
| 14 |
export const PanelMain: React.FunctionComponent<PanelMainProps> = ({ |
| 15 |
className, |
| 16 |
children, |
| 17 |
maxHeight, |
| 18 |
...props |
| 19 |
}: PanelMainProps) => ( |
| 20 |
<div |
| 21 |
className={css(styles.panelMain, className)} |
| 22 |
style={{ [cssMaxHeight.name]: maxHeight } as React.CSSProperties} |
| 23 |
{...props} |
| 24 |
> |
| 25 |
{children} |
| 26 |
</div> |
| 27 |
); |
| 28 |
|
| 29 |
PanelMain.displayName = 'PanelMain'; |