import {Component} from 'react'; import ErrorBoundary from 'sentry/components/errorBoundary'; import type {RouteComponentProps} from 'sentry/types/legacyReactRouter'; import type {Organization} from 'sentry/types/organization'; import withOrganization from 'sentry/utils/withOrganization'; import {PlanTier} from 'getsentry/types'; import AMCheckout from 'getsentry/views/amCheckout'; type Props = { organization: Organization; } & RouteComponentProps, unknown>; type State = { tier: string | null; }; class DecideCheckout extends Component { state: State = { tier: null, }; onToggleLegacy = (tier: string) => { this.setState({tier}); }; render() { const {tier} = this.state; const props = {...this.props, onToggleLegacy: this.onToggleLegacy}; const hasAm3Feature = props.organization?.features?.includes('am3-billing'); const hasPartnerMigrationFeature = props.organization?.features.includes( 'partner-billing-migration' ); if (hasAm3Feature || hasPartnerMigrationFeature) { return ( ); } if (tier !== PlanTier.AM1) { return ( ); } return ( ); } } export default withOrganization(DecideCheckout);