Remove payments components
[ProtonMail-WebClient.git] / packages / components / containers / credentialLeak / BreachListUpgradeLink.tsx
blobec7ebb38c7d4ddfc4ca71c38cbd2d62dd3f57312
1 import { c } from 'ttag';
3 import { Button } from '@proton/atoms';
4 import { useSubscriptionModal } from '@proton/components/containers/payments/subscription/SubscriptionModalProvider';
5 import { SUBSCRIPTION_STEPS } from '@proton/components/containers/payments/subscription/constants';
7 interface Props {
8     total: number;
11 const BreachListUpgradeLink = ({ total }: Props) => {
12     const [openSubscriptionModal] = useSubscriptionModal();
13     const metrics = {
14         source: 'plans',
15     } as const;
17     const handleUpgradeClick = () => {
18         openSubscriptionModal({
19             step: SUBSCRIPTION_STEPS.PLAN_SELECTION,
20             metrics,
21             mode: 'upsell-modal',
22         });
23     };
24     const numOfBreaches = total - 1;
26     return (
27         <div className="text-center color-weak">
28             <span className="block text-md text-bold ">{c('Info').jt`Plus ${numOfBreaches} more`}</span>
29             <Button
30                 onClick={handleUpgradeClick}
31                 size="small"
32                 shape="underline"
33                 color="norm"
34                 data-testid="explore-other-plan"
35             >{c('Action').t`Upgrade to view all`}</Button>
36         </div>
37     );
40 export default BreachListUpgradeLink;