performanceDisplayContext.tsx 539 B

123456789101112131415161718
  1. import {PROJECT_PERFORMANCE_TYPE} from 'sentry/views/performance/utils';
  2. import {createDefinedContext} from './utils';
  3. type useCurrentPerformanceView = {
  4. performanceType: PROJECT_PERFORMANCE_TYPE;
  5. };
  6. const [PerformanceDisplayProvider, _usePerformanceDisplayType] =
  7. createDefinedContext<useCurrentPerformanceView>({
  8. name: 'CurrentPerformanceViewContext',
  9. });
  10. export {PerformanceDisplayProvider};
  11. export function usePerformanceDisplayType(): PROJECT_PERFORMANCE_TYPE {
  12. return _usePerformanceDisplayType().performanceType;
  13. }