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