1 import { c } from 'ttag';
3 import { Button } from '@proton/atoms';
4 import Alert from '@proton/components/components/alert/Alert';
5 import type { ModalProps } from '@proton/components/components/modalTwo/Modal';
6 import Prompt from '@proton/components/components/prompt/Prompt';
7 import { MAIL_APP_NAME, VPN_APP_NAME } from '@proton/shared/lib/constants';
9 export interface DowngradeModalProps extends ModalProps {
12 onConfirm: () => void;
15 const DowngradeModal = ({ hasMail, hasVpn, onConfirm, onClose, ...rest }: DowngradeModalProps) => {
16 const hasBundle = hasMail && hasVpn;
20 title={c('Title').t`Confirm downgrade`}
28 data-testid="confirm-downgrade-btn"
30 {c('Action').t`Downgrade`}
32 <Button onClick={onClose}>{c('Action').t`Cancel`}</Button>,
35 data-testid="confirm-downgrade-modal"
38 <Alert className="mb-4" type="error">
42 .t`If you proceed with the downgrade, you will lose access to ${MAIL_APP_NAME} and ${VPN_APP_NAME} paid features.`;
47 .t`If you proceed with the downgrade, you will lose access to ${MAIL_APP_NAME} paid features, including additional storage and filters.`;
51 .t`If you proceed with the downgrade, you will lose access to ${VPN_APP_NAME} paid features.`;
54 <Alert type="warning">
58 .t`You must disable or remove any additional ${MAIL_APP_NAME} users, addresses, and custom domains before you can downgrade.`,
59 hasVpn && c('Info').t`Downgrading will terminate any connections to paid ${VPN_APP_NAME} servers.`,
68 export default DowngradeModal;