index.tsx 844 B

123456789101112131415161718192021222324252627282930
  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 withOrganization from 'sentry/utils/withOrganization';
  7. type Props = {
  8. children: React.ReactChildren;
  9. organization: Organization;
  10. };
  11. function ProfilingContainer({organization, children}: Props) {
  12. return (
  13. <Feature
  14. hookName="feature-disabled:profiling-page"
  15. features={['profiling']}
  16. organization={organization}
  17. renderDisabled={() => (
  18. <PageContent>
  19. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  20. </PageContent>
  21. )}
  22. >
  23. {children}
  24. </Feature>
  25. );
  26. }
  27. export default withOrganization(ProfilingContainer);