start removing account
[ProtonMail-WebClient.git] / packages / components / containers / domains / CatchAllSection.tsx
blob1eb9adffeaa4b281862e8a12dbbd664219b65a26
1 import { c } from 'ttag';
3 import SettingsParagraph from '@proton/components/containers/account/SettingsParagraph';
4 import SettingsSectionWide from '@proton/components/containers/account/SettingsSectionWide';
5 import UpgradeBanner from '@proton/components/containers/account/UpgradeBanner';
6 import {
7     APP_UPSELL_REF_PATH,
8     BRAND_NAME,
9     MAIL_APP_NAME,
10     MAIL_UPSELL_PATHS,
11     PLANS,
12     PLAN_NAMES,
13     UPSELL_COMPONENT,
14 } from '@proton/shared/lib/constants';
15 import { getUpsellRef } from '@proton/shared/lib/helpers/upsell';
16 import { getKnowledgeBaseUrl } from '@proton/shared/lib/helpers/url';
18 import { useUser } from '../../hooks';
20 const CatchAllSection = () => {
21     const [{ isAdmin, isSubUser }] = useUser();
22     const hasPermission = isAdmin && !isSubUser;
24     const plus = PLAN_NAMES[PLANS.MAIL];
25     const bundle = PLAN_NAMES[PLANS.BUNDLE];
27     const upsellRef = getUpsellRef({
28         app: APP_UPSELL_REF_PATH.MAIL_UPSELL_REF_PATH,
29         component: UPSELL_COMPONENT.BANNER,
30         feature: MAIL_UPSELL_PATHS.CATCH_ALL,
31         isSettings: true,
32     });
34     return (
35         <SettingsSectionWide>
36             <SettingsParagraph learnMoreUrl={getKnowledgeBaseUrl('/catch-all')}>
37                 {c('Info')
38                     .t`If you have a custom domain with ${MAIL_APP_NAME}, you can set a catch-all email address to receive messages sent to your domain but to an invalid email address (e.g., because of typos).`}
39             </SettingsParagraph>
40             {!hasPermission && (
41                 <UpgradeBanner upsellPath={upsellRef}>
42                     {c('new_plans: upgrade').t`Included with ${plus}, ${bundle}, and ${BRAND_NAME} for Business.`}
43                 </UpgradeBanner>
44             )}
45         </SettingsSectionWide>
46     );
49 export default CatchAllSection;