promotions.tsx 416 B

12345678910
  1. import type {PromotionData} from 'getsentry/types';
  2. /**
  3. * Returns a promotion if there is one that is either completed or active
  4. * which means that a discount is applicable to the subscription
  5. */
  6. export function getCompletedOrActivePromotion(promotionData?: PromotionData) {
  7. // only ever one completed or active promo
  8. return promotionData?.completedPromotions?.[0] ?? promotionData?.activePromotions?.[0];
  9. }