index.tsx 970 B

123456789101112131415161718192021222324252627282930313233
  1. import Feature from 'sentry/components/acl/feature';
  2. import {Alert} from 'sentry/components/alert';
  3. import * as Layout from 'sentry/components/layouts/thirds';
  4. import NoProjectMessage from 'sentry/components/noProjectMessage';
  5. import {t} from 'sentry/locale';
  6. import useOrganization from 'sentry/utils/useOrganization';
  7. const profilingFeature = ['profiling'];
  8. type Props = {
  9. children: React.ReactNode;
  10. };
  11. function ProfilingContainer({children}: Props) {
  12. const organization = useOrganization();
  13. return (
  14. <Feature
  15. hookName="feature-disabled:profiling-page"
  16. features={profilingFeature}
  17. organization={organization}
  18. renderDisabled={() => (
  19. <Layout.Page withPadding>
  20. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  21. </Layout.Page>
  22. )}
  23. >
  24. <NoProjectMessage organization={organization}>{children}</NoProjectMessage>
  25. </Feature>
  26. );
  27. }
  28. export default ProfilingContainer;