import React, { FC } from 'react'; import { InfoBox } from '@grafana/ui'; import { AlertManagerCortexConfig } from 'app/plugins/datasource/alertmanager/types'; import { GRAFANA_RULES_SOURCE_NAME } from '../../utils/datasource'; import { CloudReceiverForm } from './form/CloudReceiverForm'; import { GrafanaReceiverForm } from './form/GrafanaReceiverForm'; interface Props { receiverName: string; config: AlertManagerCortexConfig; alertManagerSourceName: string; } export const EditReceiverView: FC = ({ config, receiverName, alertManagerSourceName }) => { const receiver = config.alertmanager_config.receivers?.find(({ name }) => name === receiverName); if (!receiver) { return ( Sorry, this receiver does not seem to exit. ); } if (alertManagerSourceName === GRAFANA_RULES_SOURCE_NAME) { return ; } else { return ; } };