|
@@ -47,6 +47,8 @@ const EnhancedTable: FC<TableType> = props => {
|
|
} = props;
|
|
} = props;
|
|
const { t: commonTrans } = useTranslation();
|
|
const { t: commonTrans } = useTranslation();
|
|
|
|
|
|
|
|
+ const hasData = rows && rows.length > 0;
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<TableContainer
|
|
<TableContainer
|
|
sx={theme => ({
|
|
sx={theme => ({
|
|
@@ -62,6 +64,7 @@ const EnhancedTable: FC<TableType> = props => {
|
|
stickyHeader
|
|
stickyHeader
|
|
sx={{
|
|
sx={{
|
|
minWidth: '100%',
|
|
minWidth: '100%',
|
|
|
|
+ height: hasData ? 'auto' : '100%',
|
|
}}
|
|
}}
|
|
aria-labelledby="tableTitle"
|
|
aria-labelledby="tableTitle"
|
|
size="medium"
|
|
size="medium"
|
|
@@ -84,7 +87,7 @@ const EnhancedTable: FC<TableType> = props => {
|
|
)}
|
|
)}
|
|
|
|
|
|
<TableBody>
|
|
<TableBody>
|
|
- {rows && rows.length ? (
|
|
|
|
|
|
+ {hasData ? (
|
|
rows.map((row, index) => {
|
|
rows.map((row, index) => {
|
|
const isItemSelected = isSelected(row);
|
|
const isItemSelected = isSelected(row);
|
|
const labelId = `enhanced-table-checkbox-${index}`;
|
|
const labelId = `enhanced-table-checkbox-${index}`;
|