mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Grafana-ui: fixes no data message in Table component (#30821)
* Wip * fix(grafana-ui): add no data message to Table component
This commit is contained in:
parent
9b4d4915b0
commit
4f684cc498
@ -206,15 +206,21 @@ export const Table: FC<Props> = memo((props: Props) => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<FixedSizeList
|
{rows.length > 0 ? (
|
||||||
height={height - headerHeight}
|
<FixedSizeList
|
||||||
itemCount={rows.length}
|
height={height - headerHeight}
|
||||||
itemSize={tableStyles.rowHeight}
|
itemCount={rows.length}
|
||||||
width={'100%'}
|
itemSize={tableStyles.rowHeight}
|
||||||
style={{ overflow: 'hidden auto' }}
|
width={'100%'}
|
||||||
>
|
style={{ overflow: 'hidden auto' }}
|
||||||
{RenderRow}
|
>
|
||||||
</FixedSizeList>
|
{RenderRow}
|
||||||
|
</FixedSizeList>
|
||||||
|
) : (
|
||||||
|
<div style={{ height: height - headerHeight }} className={tableStyles.noData}>
|
||||||
|
No data to show
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</CustomScrollbar>
|
</CustomScrollbar>
|
||||||
</div>
|
</div>
|
||||||
|
@ -157,6 +157,13 @@ export const getTableStyles = stylesFactory((theme: GrafanaTheme) => {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 0 ${theme.spacing.xxs};
|
padding: 0 ${theme.spacing.xxs};
|
||||||
`,
|
`,
|
||||||
|
noData: css`
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
`,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user