import {Component} from 'react'; import SentryTypes from 'sentry/sentryTypes'; import {Organization} from 'sentry/types'; import getDisplayName from 'sentry/utils/getDisplayName'; type InjectedOrganizationProps = { organization?: Organization; }; const withOrganization =

( WrappedComponent: React.ComponentType

) => class extends Component< Omit & InjectedOrganizationProps > { static displayName = `withOrganization(${getDisplayName(WrappedComponent)})`; static contextTypes = { organization: SentryTypes.Organization, }; render() { const {organization, ...props} = this.props; return ( ); } }; export default withOrganization;