AlertLabels.tsx 459 B

1234567891011121314
  1. import React from 'react';
  2. import { TagList } from '@grafana/ui';
  3. type Props = { labels: Record<string, string>; className?: string };
  4. export const AlertLabels = ({ labels, className }: Props) => {
  5. const pairs = Object.entries(labels).filter(([key]) => !(key.startsWith('__') && key.endsWith('__')));
  6. return (
  7. <div className={className}>
  8. <TagList tags={Object.values(pairs).map(([label, value]) => `${label}=${value}`)} />
  9. </div>
  10. );
  11. };