import React from 'react'; import { Alert } from '@grafana/ui'; import { useAlertManagerSourceName } from '../hooks/useAlertManagerSourceName'; import { AlertManagerDataSource } from '../utils/datasource'; import { AlertManagerPicker } from './AlertManagerPicker'; interface Props { availableAlertManagers: AlertManagerDataSource[]; } const NoAlertManagersAvailable = () => ( We could not find any external Alertmanagers and you may not have access to the built-in Grafana Alertmanager. ); const OtherAlertManagersAvailable = () => ( Selected Alertmanager no longer exists or you may not have permission to access it. ); export const NoAlertManagerWarning = ({ availableAlertManagers }: Props) => { const [_, setAlertManagerSourceName] = useAlertManagerSourceName(availableAlertManagers); const hasOtherAMs = availableAlertManagers.length > 0; return (
{hasOtherAMs ? ( <> ) : ( )}
); };