1 import type { AddressAuditWarningDetails } from '@proton/key-transparency/lib';
2 import { AddressAuditWarningReason } from '@proton/key-transparency/lib';
4 export const getWarningReason = (warningDetails?: AddressAuditWarningDetails) => {
8 const { reason, sklVerificationFailed, addressWasDisabled } = warningDetails;
9 if (reason === AddressAuditWarningReason.UnverifiableHistory) {
10 if (addressWasDisabled) {
11 return 'disabled_address';
14 if (sklVerificationFailed) {
15 return 'skl_verification_failed';
18 return 'unverifiable_history';
20 if (reason === AddressAuditWarningReason.AddressWithNoKeys) {
21 return 'address_with_no_keys';
23 // should not fall here