1 import { PLAN_TYPES } from '../constants';
3 export const isManagedByMozilla = ({ CouponCode }: { CouponCode?: string | null } = {}) => {
4 const coupon = CouponCode || ''; // CouponCode can be null
5 return coupon.startsWith('MOZILLA') || coupon.startsWith('MOZTEST');
8 interface SubcriptionPlan {
13 export const getSubscriptionPlans = <P extends SubcriptionPlan>({ Plans = [] }: { Plans: P[] }) =>
14 Plans.filter(({ Type }) => Type === PLAN_TYPES.PLAN);
16 export const getSubscriptionTitle = <P extends SubcriptionPlan>({ Plans = [] }: { Plans: P[] }) => {
17 return getSubscriptionPlans({ Plans })
18 .map(({ Title }) => Title)