mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import React from 'react';
|
||
import { Disable, Enable } from 'react-enable';
|
||
|
||
import { withErrorBoundary } from '@grafana/ui';
|
||
const ContactPointsV1 = SafeDynamicImport(() => import('./components/contact-points/ContactPoints.v1'));
|
||
const ContactPointsV2 = SafeDynamicImport(() => import('./components/contact-points/ContactPoints.v2'));
|
||
import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport';
|
||
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
|
||
|
||
import { AlertmanagerPageWrapper } from './components/AlertingPageWrapper';
|
||
import { AlertingFeature } from './features';
|
||
// TODO add pagenav back in – what are we missing if we don't specify it?
|
||
const ContactPoints = (props: GrafanaRouteComponentProps): JSX.Element => (
|
||
<AlertmanagerPageWrapper pageId="receivers" accessType="notification">
|
||
<Enable feature={AlertingFeature.ContactPointsV2}>
|
||
<ContactPointsV2 {...props} />
|
||
</Enable>
|
||
<Disable feature={AlertingFeature.ContactPointsV2}>
|
||
<ContactPointsV1 {...props} />
|
||
</Disable>
|
||
</AlertmanagerPageWrapper>
|
||
);
|
||
|
||
export default withErrorBoundary(ContactPoints, { style: 'page' });
|