| 1 |
import { forwardRef } from 'react'; |
| 2 |
import { css } from '@patternfly/react-styles'; |
| 3 |
import styles from '@patternfly/react-styles/css/components/Table/table-scrollable'; |
| 4 |
|
| 5 |
export interface InnerScrollContainerProps extends React.HTMLProps<HTMLDivElement> { |
| 6 |
/** Content rendered inside the inner scroll container */ |
| 7 |
children?: React.ReactNode; |
| 8 |
/** Additional classes added to the container */ |
| 9 |
className?: string; |
| 10 |
/** @hide Forwarded ref */ |
| 11 |
innerRef?: React.Ref<HTMLDivElement>; |
| 12 |
} |
| 13 |
|
| 14 |
const InnerScrollContainerBase: React.FunctionComponent<InnerScrollContainerProps> = ({ |
| 15 |
children, |
| 16 |
className, |
| 17 |
innerRef, |
| 18 |
...props |
| 19 |
}: InnerScrollContainerProps) => ( |
| 20 |
<div ref={innerRef} className={css(className, styles.scrollInnerWrapper)} {...props}> |
| 21 |
{children} |
| 22 |
</div> |
| 23 |
); |
| 24 |
|
| 25 |
export const InnerScrollContainer = forwardRef((props: InnerScrollContainerProps, ref: React.Ref<HTMLDivElement>) => ( |
| 26 |
<InnerScrollContainerBase innerRef={ref} {...props} /> |
| 27 |
)); |
| 28 |
InnerScrollContainer.displayName = 'InnerScrollContainer'; |