Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / containers / forward / ForwardStatus.tsx
blob4a961a51db6efc68bd05bba299bcccf05623f5b7
1 import { c } from 'ttag';
3 import Badge from '@proton/components/components/badge/Badge';
4 import type { IncomingAddressForwarding, OutgoingAddressForwarding } from '@proton/shared/lib/interfaces';
5 import { ForwardingState } from '@proton/shared/lib/interfaces';
7 interface Props {
8     forward: IncomingAddressForwarding | OutgoingAddressForwarding;
11 const ForwardStatus = ({ forward }: Props) => {
12     if (forward.State === ForwardingState.Pending) {
13         return (
14             <Badge
15                 type="origin"
16                 tooltip={c('email_forwarding_2023: Info')
17                     .t`Forwardee is invited and needs to accept/reject the invitation or update`}
18             >{c('email_forwarding_2023: Status').t`Pending`}</Badge>
19         );
20     }
21     if (forward.State === ForwardingState.Active) {
22         return (
23             <Badge type="success" tooltip={c('email_forwarding_2023: Info').t`Forwarding is active`}>{c(
24                 'email_forwarding_2023: Status'
25             ).t`Active`}</Badge>
26         );
27     }
28     if (forward.State === ForwardingState.Outdated) {
29         return (
30             <Badge type="warning" tooltip={c('email_forwarding_2023: Info').t`Please update your forwarding keys`}>{c(
31                 'email_forwarding_2023: Status'
32             ).t`Outdated`}</Badge>
33         );
34     }
35     if (forward.State === ForwardingState.Paused) {
36         return (
37             <Badge type="origin" tooltip={c('email_forwarding_2023: Info').t`The forwarding is temporarily paused`}>{c(
38                 'email_forwarding_2023: Status'
39             ).t`Paused`}</Badge>
40         );
41     }
42     if (forward.State === ForwardingState.Rejected) {
43         return (
44             <Badge
45                 type="origin"
46                 tooltip={c('email_forwarding_2023: Info').t`The forwardee rejected the forwarding request`}
47             >{c('email_forwarding_2023: Status').t`Declined`}</Badge>
48         );
49     }
50     return null;
53 export default ForwardStatus;