1 import { type MaybeNull, type PassPlanResponse, PlanType } from '@proton/pass/types';
2 import { UserPassPlan } from '@proton/pass/types/api/plan';
3 import { getEpoch } from '@proton/pass/utils/time/epoch';
5 export const getPassPlan = (plan?: MaybeNull<PassPlanResponse>): UserPassPlan => {
8 return plan.TrialEnd && getEpoch() < plan.TrialEnd ? UserPassPlan.TRIAL : UserPassPlan.PLUS;
9 case PlanType.business:
10 return UserPassPlan.BUSINESS;
12 return UserPassPlan.FREE;