index.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {useCallback} from 'react';
  2. import Feature from 'sentry/components/acl/feature';
  3. import FeatureDisabled from 'sentry/components/acl/featureDisabled';
  4. import {t} from 'sentry/locale';
  5. import type {Organization} from 'sentry/types';
  6. import Trace from 'sentry/views/replays/detail/trace/trace';
  7. import type {ReplayRecord} from 'sentry/views/replays/types';
  8. type Props = {
  9. organization: Organization;
  10. replayRecord: ReplayRecord;
  11. };
  12. const features = ['organizations:performance-view'];
  13. function TraceFeature({organization, replayRecord}: Props) {
  14. const renderDisabled = useCallback(
  15. () => (
  16. <FeatureDisabled
  17. featureName={t('Performance Monitoring')}
  18. features={features}
  19. hideHelpToggle
  20. message={t('Requires performance monitoring.')}
  21. />
  22. ),
  23. []
  24. );
  25. // TODO(replays): Configure an upsell message for when tracing is disabled
  26. return (
  27. <Feature
  28. features={features}
  29. hookName={undefined}
  30. organization={organization}
  31. renderDisabled={renderDisabled}
  32. >
  33. <Trace organization={organization} replayRecord={replayRecord} />
  34. </Feature>
  35. );
  36. }
  37. export default TraceFeature;