import { css, cx } from '@emotion/css'; import React, { FC } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { useStyles2 } from '@grafana/ui'; import { AlertmanagerAlert } from 'app/plugins/datasource/alertmanager/types'; import { getAlertTableStyles } from '../../styles/table'; import { SilencedAlertsTableRow } from './SilencedAlertsTableRow'; interface Props { silencedAlerts: AlertmanagerAlert[]; } const SilencedAlertsTable: FC = ({ silencedAlerts }) => { const tableStyles = useStyles2(getAlertTableStyles); const styles = useStyles2(getStyles); if (!!silencedAlerts.length) { return ( {silencedAlerts.map((alert, index) => { return ( ); })}
State Alert name
); } else { return null; } }; const getStyles = (theme: GrafanaTheme2) => ({ tableMargin: css` margin-bottom: ${theme.spacing(1)}; `, colState: css` width: 110px; `, colName: css` width: 65%; `, }); export default SilencedAlertsTable;