NoData.tsx 932 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { css } from '@emotion/css';
  2. import React from 'react';
  3. import { GrafanaTheme2 } from '@grafana/data/src';
  4. import { useStyles2, PanelContainer } from '@grafana/ui';
  5. export const NoData = () => {
  6. const css = useStyles2(getStyles);
  7. return (
  8. <>
  9. <PanelContainer data-testid="explore-no-data" className={css.wrapper}>
  10. <span className={css.message}>{'No data'}</span>
  11. </PanelContainer>
  12. </>
  13. );
  14. };
  15. const getStyles = (theme: GrafanaTheme2) => ({
  16. wrapper: css`
  17. label: no-data-card;
  18. padding: ${theme.spacing(3)};
  19. background: ${theme.colors.background.primary};
  20. border-radius: ${theme.shape.borderRadius(2)};
  21. display: flex;
  22. flex-direction: column;
  23. align-items: center;
  24. justify-content: center;
  25. flex-grow: 1;
  26. `,
  27. message: css`
  28. font-size: ${theme.typography.h2.fontSize};
  29. padding: ${theme.spacing(4)};
  30. color: ${theme.colors.text.disabled};
  31. `,
  32. });