notificationSettingsController.tsx 815 B

12345678910111213141516171819202122232425
  1. import {RouteComponentProps} from 'react-router';
  2. import {Organization} from 'sentry/types';
  3. import withOrganizations from 'sentry/utils/withOrganizations';
  4. import NotificationSettings from './notificationSettings';
  5. import NotificationSettingsV2 from './notificationSettingsV2';
  6. type Props = RouteComponentProps<{fineTuneType: string}, {}> & {
  7. organizations: Organization[];
  8. };
  9. export function NotificationSettingsController({organizations, ...props}: Props) {
  10. // check if feature is enabled for any organization
  11. const hasFeature = organizations.some(org =>
  12. org.features.includes('notification-settings-v2')
  13. );
  14. return hasFeature ? (
  15. <NotificationSettingsV2 {...props} />
  16. ) : (
  17. <NotificationSettings {...props} />
  18. );
  19. }
  20. export default withOrganizations(NotificationSettingsController);