accountNotificationFineTuningController.tsx 893 B

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