mirror of
https://github.com/grafana/grafana.git
synced 2025-09-20 23:37:25 +08:00

* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
28 lines
741 B
TypeScript
28 lines
741 B
TypeScript
import React, { FC } from 'react';
|
|
|
|
import { Alert } from 'app/types/unified-alerting';
|
|
|
|
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>
|
|
);
|
|
};
|