2020-11-25 10:21:48 +01:00
|
|
|
import React, { PropsWithChildren, ReactElement } from 'react';
|
|
|
|
|
import { useStyles } from '@grafana/ui';
|
|
|
|
|
import { GrafanaTheme } from '@grafana/data';
|
2021-04-01 14:15:23 +02:00
|
|
|
import { css } from '@emotion/css';
|
2020-11-25 10:21:48 +01:00
|
|
|
|
|
|
|
|
interface VariableSectionHeaderProps {
|
|
|
|
|
name: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function VariableSectionHeader({ name }: PropsWithChildren<VariableSectionHeaderProps>): ReactElement {
|
|
|
|
|
const styles = useStyles(getStyles);
|
|
|
|
|
|
|
|
|
|
return <h5 className={styles.sectionHeading}>{name}</h5>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getStyles(theme: GrafanaTheme) {
|
|
|
|
|
return {
|
|
|
|
|
sectionHeading: css`
|
|
|
|
|
label: sectionHeading;
|
|
|
|
|
font-size: ${theme.typography.size.md};
|
|
|
|
|
margin-bottom: ${theme.spacing.sm};
|
|
|
|
|
`,
|
|
|
|
|
};
|
|
|
|
|
}
|