overleaf/services/web/frontend/js/features/subscription/util/show-downgrade-option.ts

14 lines
348 B
TypeScript
Raw Normal View History

import isInFreeTrial from './is-in-free-trial'
import isMonthlyCollaboratorPlan from './is-monthly-collaborator-plan'
export default function showDowngradeOption(
planCode: string,
isGroupPlan?: boolean,
trialEndsAt?: string | null
) {
return (
isMonthlyCollaboratorPlan(planCode, isGroupPlan) &&
!isInFreeTrial(trialEndsAt)
)
}