NoRulesCTA.tsx 895 B

1234567891011121314151617181920212223242526
  1. import React, { FC } from 'react';
  2. import { CallToActionCard } from '@grafana/ui';
  3. import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
  4. import { useRulesAccess } from '../../utils/accessControlHooks';
  5. export const NoRulesSplash: FC = () => {
  6. const { canCreateGrafanaRules, canCreateCloudRules } = useRulesAccess();
  7. if (canCreateGrafanaRules || canCreateCloudRules) {
  8. return (
  9. <EmptyListCTA
  10. title="You haven`t created any alert rules yet"
  11. buttonIcon="bell"
  12. buttonLink={'alerting/new'}
  13. buttonTitle="New alert rule"
  14. proTip="you can also create alert rules from existing panels and queries."
  15. proTipLink="https://grafana.com/docs/"
  16. proTipLinkTitle="Learn more"
  17. proTipTarget="_blank"
  18. />
  19. );
  20. }
  21. return <CallToActionCard message="No rules exist yet." callToActionElement={<div />} />;
  22. };