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.
25 lines
739 B
25 lines
739 B
import { Alert } from 'app/types/unified-alerting';
|
|
import React, { FC } from 'react';
|
|
import { AnnotationDetailsField } from '../AnnotationDetailsField';
|
|
import { DetailsField } from '../DetailsField';
|
|
|
|
interface Props {
|
|
instance: Alert;
|
|
}
|
|
|
|
export const AlertInstanceDetails: FC<Props> = ({ instance }) => {
|
|
const annotations = (Object.entries(instance.annotations || {}) || []).filter(([_, value]) => !!value.trim());
|
|
|
|
return (
|
|
<div>
|
|
{instance.value && (
|
|
<DetailsField label="Value" horizontal={true}>
|
|
{instance.value}
|
|
</DetailsField>
|
|
)}
|
|
{annotations.map(([key, value]) => (
|
|
<AnnotationDetailsField key={key} annotationKey={key} value={value} />
|
|
))}
|
|
</div>
|
|
);
|
|
};
|
|
|