index.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import Feature from 'sentry/components/acl/feature';
  2. import Alert from 'sentry/components/alert';
  3. import {t} from 'sentry/locale';
  4. import {PageContent} from 'sentry/styles/organization';
  5. import {Organization} from 'sentry/types';
  6. import {MEPSettingProvider} from 'sentry/utils/performance/contexts/metricsEnhancedSetting';
  7. import withOrganization from 'sentry/utils/withOrganization';
  8. type Props = {
  9. children: React.ReactChildren;
  10. organization: Organization;
  11. };
  12. function PerformanceContainer({organization, children}: Props) {
  13. function renderNoAccess() {
  14. return (
  15. <PageContent>
  16. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  17. </PageContent>
  18. );
  19. }
  20. return (
  21. <Feature
  22. hookName="feature-disabled:performance-page"
  23. features={['performance-view']}
  24. organization={organization}
  25. renderDisabled={renderNoAccess}
  26. >
  27. <MEPSettingProvider>{children}</MEPSettingProvider>
  28. </Feature>
  29. );
  30. }
  31. export default withOrganization(PerformanceContainer);