grafana/public/app/features/alerting/unified/components/silences/NoSilencesCTA.tsx
Gilles De Mey 702fd0f9e8
Docs: Update wording / text and copy (#61868)
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2023-01-30 15:26:21 +00:00

29 lines
958 B
TypeScript

import React, { FC } from 'react';
import { CallToActionCard } from '@grafana/ui';
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
import { contextSrv } from 'app/core/services/context_srv';
import { getInstancesPermissions } from '../../utils/access-control';
import { makeAMLink } from '../../utils/misc';
type Props = {
alertManagerSourceName: string;
};
export const NoSilencesSplash: FC<Props> = ({ alertManagerSourceName }) => {
const permissions = getInstancesPermissions(alertManagerSourceName);
if (contextSrv.hasAccess(permissions.create, contextSrv.isEditor)) {
return (
<EmptyListCTA
title="You haven't created any silences yet"
buttonIcon="bell-slash"
buttonLink={makeAMLink('alerting/silence/new', alertManagerSourceName)}
buttonTitle="Create silence"
/>
);
}
return <CallToActionCard callToActionElement={<div />} message="No silences found." />;
};