VariableSectionHeader.tsx 670 B

12345678910111213141516171819202122232425
  1. import { css } from '@emotion/css';
  2. import React, { PropsWithChildren, ReactElement } from 'react';
  3. import { GrafanaTheme } from '@grafana/data';
  4. import { useStyles } from '@grafana/ui';
  5. interface VariableSectionHeaderProps {
  6. name: string;
  7. }
  8. export function VariableSectionHeader({ name }: PropsWithChildren<VariableSectionHeaderProps>): ReactElement {
  9. const styles = useStyles(getStyles);
  10. return <h5 className={styles.sectionHeading}>{name}</h5>;
  11. }
  12. function getStyles(theme: GrafanaTheme) {
  13. return {
  14. sectionHeading: css`
  15. label: sectionHeading;
  16. font-size: ${theme.typography.size.md};
  17. margin-bottom: ${theme.spacing.sm};
  18. `,
  19. };
  20. }