2022-05-31 07:43:23 -05:00
|
|
|
import { css } from '@emotion/css';
|
2022-04-22 08:33:13 -05:00
|
|
|
import React from 'react';
|
2022-04-13 10:17:07 -05:00
|
|
|
|
|
|
|
import { GrafanaTheme2 } from '@grafana/data/src';
|
2022-05-31 07:43:23 -05:00
|
|
|
import { useStyles2, PanelContainer } from '@grafana/ui';
|
2022-04-13 10:17:07 -05:00
|
|
|
|
|
|
|
export const NoData = () => {
|
|
|
|
const css = useStyles2(getStyles);
|
|
|
|
return (
|
|
|
|
<>
|
2022-05-31 07:43:23 -05:00
|
|
|
<PanelContainer data-testid="explore-no-data" className={css.wrapper}>
|
|
|
|
<span className={css.message}>{'No data'}</span>
|
|
|
|
</PanelContainer>
|
2022-04-13 10:17:07 -05:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const getStyles = (theme: GrafanaTheme2) => ({
|
|
|
|
wrapper: css`
|
|
|
|
label: no-data-card;
|
|
|
|
padding: ${theme.spacing(3)};
|
|
|
|
background: ${theme.colors.background.primary};
|
|
|
|
border-radius: ${theme.shape.borderRadius(2)};
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-grow: 1;
|
|
|
|
`,
|
|
|
|
message: css`
|
2022-04-14 10:22:09 -05:00
|
|
|
font-size: ${theme.typography.h2.fontSize};
|
|
|
|
padding: ${theme.spacing(4)};
|
2022-04-13 10:17:07 -05:00
|
|
|
color: ${theme.colors.text.disabled};
|
|
|
|
`,
|
|
|
|
});
|