import React from 'react'; import createReactClass from 'create-react-class'; import Reflux from 'reflux'; import SentryAppComponentsStore from 'app/stores/sentryAppComponentsStore'; import getDisplayName from 'app/utils/getDisplayName'; // TODO(ts): Update when component type is defined type Component = {}; type InjectedAppComponentsProps = { components: Component[]; }; type State = { components: Component[]; }; type Options = { componentType?: 'stacktrace-link'; }; const withSentryAppComponents =

( WrappedComponent: React.ComponentType

, {componentType}: Options = {} ) => createReactClass< Omit & Partial, State >({ displayName: `withSentryAppComponents(${getDisplayName(WrappedComponent)})`, mixins: [Reflux.connect(SentryAppComponentsStore, 'components') as any], render() { const {components, ...props} = this.props as P; return ( ); }, }); export default withSentryAppComponents;