index.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Feature from 'sentry/components/acl/feature';
  2. import FeatureDisabled from 'sentry/components/acl/featureDisabled';
  3. import {useReplayContext} from 'sentry/components/replays/replayContext';
  4. import {t} from 'sentry/locale';
  5. import useOrganization from 'sentry/utils/useOrganization';
  6. import Trace from 'sentry/views/replays/detail/trace/trace';
  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() {
  19. const organization = useOrganization();
  20. const {replay} = useReplayContext();
  21. const replayRecord = replay?.getReplay();
  22. return (
  23. <Feature
  24. features={features}
  25. hookName={undefined}
  26. organization={organization}
  27. renderDisabled={PerfDisabled}
  28. >
  29. <Trace replayRecord={replayRecord} />
  30. </Feature>
  31. );
  32. }
  33. export default TraceFeature;