1 import type { FC, ReactNode } from 'react';
3 import { c } from 'ttag';
5 import monitorSVG from '@proton/pass/assets/monitor/upgrade.svg';
6 import onboardingSVG from '@proton/pass/assets/onboarding.svg';
7 import { UpgradeButton } from '@proton/pass/components/Layout/Button/UpgradeButton';
8 import { type AdapativeModalProps, AdaptiveModal } from '@proton/pass/components/Layout/Modal/AdaptiveModal';
9 import { type UpsellRef } from '@proton/pass/constants';
11 import { FreeTrialActions } from './FreeTrialActions';
12 import { UpsellFeatures } from './UpsellFeatures';
14 type UpsellModalContent = {
21 export type UpsellType = 'free-trial' | 'pass-plus' | 'early-access' | 'pass-monitor' | 'pass-monitor-business';
23 export type Props = Omit<AdapativeModalProps, 'actions'> & {
24 extraActions?: (props: AdapativeModalProps) => ReactNode[];
28 upsellType: UpsellType;
31 const getContent = (type: UpsellType): UpsellModalContent =>
34 title: c('Title').t`Your welcome gift`,
35 description: undefined,
36 upgradeLabel: c('Action').t`Upgrade now`,
41 description: c('Info')
42 .t`Get unlimited aliases, enjoy exclusive features, and support us by subscribing to Pass Plus.`,
43 upgradeLabel: c('Action').t`Upgrade`,
47 title: c('Info').t`Upgrade Now to Unlock Premium Features`,
48 description: undefined,
49 upgradeLabel: c('Action').t`Upgrade now`,
53 title: c('Title').t`Stay safer online`,
54 description: c('Description')
55 .t`Dark Web Monitoring is available with a paid plan. Upgrade for immediate access.`,
56 upgradeLabel: c('Action').t`Get Pass Plus`,
59 'pass-monitor-business': {
60 title: c('Title').t`Stay safer online`,
61 description: c('Description')
62 .t`Unlock advanced security features and detailed logs to safeguard your online presence.`,
63 upgradeLabel: c('Action').t`Get Pass Business`,
68 export const UpsellingModal: FC<Props> = ({
78 const { title, description, upgradeLabel, image } = getContent(upsellType);
89 onClick={props.onClose}
93 ...(extraActions?.(props) ?? []),
96 <div className="flex flex-column items-center w-full gap-4 m-auto">
97 <img src={image} className="w-3/5 " alt="user onboarding graphic" />
98 <h4 className="text-bold">{title}</h4>
99 {description && <p className="m-2 text-md">{description}</p>}
100 {features ?? <UpsellFeatures upsellType={upsellType} />}
101 {upsellType === 'free-trial' && <FreeTrialActions />}