1 import { c } from 'ttag';
3 import Badge from '@proton/components/components/badge/Badge';
4 import Tooltip from '@proton/components/components/tooltip/Tooltip';
5 import clsx from '@proton/utils/clsx';
6 import isTruthy from '@proton/utils/isTruthy';
8 import type { AddressStatuses } from './helper';
10 const AddressStatus = ({
18 isSignatureNotExpected,
19 }: Partial<AddressStatuses>) => {
23 text: c('Address status').t`Default`,
28 text: c('Address status').t`External`,
33 text: c('Address status').t`Active`,
38 text: c('Address status').t`Disabled`,
43 text: c('Address status').t`Orphan`,
48 text: c('Address status').t`Inactive`,
50 tooltip: c('Tooltip').t`This can be caused by a password reset or the user not logging in yet.`,
54 // translator: E2EE stands for end-to-end encryption. If possible, keep the abbreviation as the UI will be best with a short translated string.
55 text: c('Address status').t`No E2EE mail`,
58 isSignatureNotExpected &&
60 text: c('Address status').t`Allow unsigned mail`,
65 .map(({ text, type, tooltip }) => {
66 const addresssBadge = (
67 <Badge key={text} type={type} className={clsx('mr-1 mb-1', tooltip && 'cursor-default')}>
74 <Tooltip title={tooltip} key={text}>
75 <span>{addresssBadge}</span>
85 export default AddressStatus;