forked from grafana.jool/grafana-jool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
719 B
31 lines
719 B
import React from 'react';
|
|
import { css } from '@emotion/css';
|
|
import { useStyles2 } from '@grafana/ui';
|
|
import { AnnotationDetailsField } from '../AnnotationDetailsField';
|
|
|
|
type Props = {
|
|
annotations: Array<[string, string]>;
|
|
};
|
|
|
|
export function RuleDetailsAnnotations(props: Props): JSX.Element | null {
|
|
const { annotations } = props;
|
|
const styles = useStyles2(getStyles);
|
|
|
|
if (annotations.length === 0) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<div className={styles.annotations}>
|
|
{annotations.map(([key, value]) => (
|
|
<AnnotationDetailsField key={key} annotationKey={key} value={value} />
|
|
))}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const getStyles = () => ({
|
|
annotations: css`
|
|
margin-top: 46px;
|
|
`,
|
|
});
|
|
|