import { VERIFICATION_STATUS } from '@proton/shared/lib/mail/constants' ; import { inSigningPeriod , isAuto , isImported } from '@proton/shared/lib/mail/messages' ; const { SIGNED_AND_INVALID , SIGNED_AND_VALID , NOT_SIGNED } = VERIFICATION_STATUS ; return { ( ) => boolean } export const displaySignatureStatus = ( { data : message = { } , verified = 0 } ) => { const isSentByMe = false ; if ( ! isSentByMe ) { return verified === SIGNED_AND_INVALID || verified === SIGNED_AND_VALID ; } const imported = isImported ( message . data ) ; const auto = isAuto ( message . data ) ; const period = inSigningPeriod ( message . data . Time ) ; if ( ! auto && ! imported && ! period ) { return false ; } if ( verified === SIGNED_AND_VALID ) { return false ; } if ( verified === NOT_SIGNED && ! auto && ! imported && period ) { return true ; } return verified === SIGNED_AND_INVALID ; } ;