index.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {Component} from 'react';
  2. import Feature from 'app/components/acl/feature';
  3. import Alert from 'app/components/alert';
  4. import {t} from 'app/locale';
  5. import {PageContent} from 'app/styles/organization';
  6. import {Organization} from 'app/types';
  7. import withOrganization from 'app/utils/withOrganization';
  8. import {MetricsSwitchContextContainer} from './metricsSwitch';
  9. type Props = {
  10. organization: Organization;
  11. };
  12. class PerformanceContainer extends Component<Props> {
  13. renderNoAccess() {
  14. return (
  15. <PageContent>
  16. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  17. </PageContent>
  18. );
  19. }
  20. render() {
  21. const {organization, children} = this.props;
  22. return (
  23. <Feature
  24. hookName="feature-disabled:performance-page"
  25. features={['performance-view']}
  26. organization={organization}
  27. renderDisabled={this.renderNoAccess}
  28. >
  29. <MetricsSwitchContextContainer>{children}</MetricsSwitchContextContainer>
  30. </Feature>
  31. );
  32. }
  33. }
  34. export default withOrganization(PerformanceContainer);