import {PageFilters} from 'sentry/types'; import getDisplayName from 'sentry/utils/getDisplayName'; import usePageFilters from './usePageFilters'; type InjectedPageFiltersProps = { isGlobalSelectionReady?: boolean; selection?: PageFilters; }; /** * Higher order component that uses PageFiltersStore and provides the active * project */ function withPageFilters

( WrappedComponent: React.ComponentType

) { type Props = Omit & InjectedPageFiltersProps; const WithPageFilters: React.FC = props => { const {selection, isReady: isGlobalSelectionReady} = usePageFilters(); const selectionProps = { selection, isGlobalSelectionReady, }; return ; }; const displayName = getDisplayName(WrappedComponent); WithPageFilters.displayName = `withPageFilters(${displayName})`; return WithPageFilters; } export default withPageFilters;