index.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import Feature from 'sentry/components/acl/feature';
  2. import {useRedirectNavV2Routes} from 'sentry/components/nav/useRedirectNavV2Routes';
  3. import {NoAccess} from 'sentry/components/noAccess';
  4. import NoProjectMessage from 'sentry/components/noProjectMessage';
  5. import Redirect from 'sentry/components/redirect';
  6. import useOrganization from 'sentry/utils/useOrganization';
  7. export const TRACE_EXPLORER_DOCS_URL = 'https://docs.sentry.io/product/explore/traces/';
  8. interface Props {
  9. children: React.ReactNode;
  10. }
  11. export default function TracesPage({children}: Props) {
  12. const organization = useOrganization();
  13. const redirectPath = useRedirectNavV2Routes({
  14. oldPathPrefix: '/traces/',
  15. newPathPrefix: '/explore/traces/',
  16. });
  17. if (redirectPath) {
  18. return <Redirect to={redirectPath} />;
  19. }
  20. return (
  21. <Feature
  22. features={['performance-trace-explorer']}
  23. organization={organization}
  24. renderDisabled={NoAccess}
  25. >
  26. <NoProjectMessage organization={organization}>{children}</NoProjectMessage>
  27. </Feature>
  28. );
  29. }