import ConfigStore from 'sentry/stores/configStore'; import {useLegacyStore} from 'sentry/stores/useLegacyStore'; import {Config} from 'sentry/types'; import getDisplayName from 'sentry/utils/getDisplayName'; type InjectedConfigProps = { config: Config; }; /** * Higher order component that passes the config object to the wrapped * component */ function withConfig

( WrappedComponent: React.ComponentType

) { type Props = Omit & Partial; const Wrapper: React.FC = props => { const config = useLegacyStore(ConfigStore); const allProps = {config, ...props} as P; return ; }; Wrapper.displayName = `withConfig(${getDisplayName(WrappedComponent)})`; return Wrapper; } export default withConfig;