index.tsx 975 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import Feature from 'sentry/components/acl/feature';
  2. import FeatureDisabled from 'sentry/components/acl/featureDisabled';
  3. import {t} from 'sentry/locale';
  4. import useOrganization from 'sentry/utils/useOrganization';
  5. import Trace from 'sentry/views/replays/detail/trace/trace';
  6. import type {ReplayRecord} from '../../types';
  7. const features = ['organizations:performance-view'];
  8. function PerfDisabled() {
  9. return (
  10. <FeatureDisabled
  11. featureName={t('Performance Monitoring')}
  12. features={features}
  13. hideHelpToggle
  14. message={t('Requires performance monitoring.')}
  15. />
  16. );
  17. }
  18. function TraceFeature({replayRecord}: {replayRecord: ReplayRecord | undefined}) {
  19. const organization = useOrganization();
  20. return (
  21. <Feature
  22. features={features}
  23. hookName={undefined}
  24. organization={organization}
  25. renderDisabled={PerfDisabled}
  26. >
  27. <Trace replayRecord={replayRecord} />
  28. </Feature>
  29. );
  30. }
  31. export default TraceFeature;