grafana/public/app/features/admin/Users/TableWrapper.tsx
Alex Khomenko a4522812fe
Admin: Use primitive components for table views (#76512)
* Remove HorizontalGroup and VerticalGroup from OrgUserstable

* Refactor OrgUnits

* Refactor UsersTable

* Add TableWrapper

* Use Stack and Flex for TeamList

* Revert pagination changes

* Update betterer

* Remove div wrapper

* Codeformat
2023-10-17 14:06:28 +03:00

31 lines
856 B
TypeScript

import { css } from '@emotion/css';
import React, { PropsWithChildren } from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { useStyles2 } from '@grafana/ui';
/**
* A wrapper component for interactive tables using RolePicker to enable overflow.
* Should be removed when the RolePicker component uses portals to render its menu
*/
export const TableWrapper = ({ children }: PropsWithChildren) => {
const styles = useStyles2(getStyles);
return <div className={styles.wrapper}>{children}</div>;
};
const getStyles = (theme: GrafanaTheme2) => ({
// Enable RolePicker overflow
wrapper: css({
display: 'flex',
flexDirection: 'column',
overflowX: 'auto',
overflowY: 'hidden',
minHeight: '100vh',
width: '100%',
'& > div': {
overflowX: 'unset',
marginBottom: theme.spacing(2),
},
}),
});