import { css } from '@emotion/css'; import { last } from 'lodash'; import React from 'react'; import { GrafanaTheme } from '@grafana/data'; import { useStyles } from '@grafana/ui'; import { DiffTitle } from './DiffTitle'; import { DiffValues } from './DiffValues'; import { Diff, getDiffText } from './utils'; type DiffGroupProps = { diffs: Diff[]; title: string; }; export const DiffGroup: React.FC = ({ diffs, title }) => { const styles = useStyles(getStyles); if (diffs.length === 1) { return (
); } return (
    {diffs.map((diff: Diff, idx: number) => { return (
  • {getDiffText(diff)}
  • ); })}
); }; const getStyles = (theme: GrafanaTheme) => ({ container: css` background-color: ${theme.colors.bg2}; font-size: ${theme.typography.size.md}; margin-bottom: ${theme.spacing.md}; padding: ${theme.spacing.md}; `, list: css` margin-left: ${theme.spacing.xl}; `, listItem: css` margin-bottom: ${theme.spacing.sm}; `, });