import i18n from 'ui-i18n';
import { InputVerificationAttribute } from '@reltio/mdm-sdk';
import { EmptyStub } from '../EmptyStub';
import VerificationInvalidIcon from '../icons/VerificationInvalidIcon';
import VerificationValidIcon from '../icons/VerificationValidIcon';
import VerificationOutdatedIcon from '../icons/VerificationOutdatedIcon';
import VerificationMaybeIcon from '../icons/VerificationMaybeIcon';
import { VerificationStatus } from '../contexts/AttributesVerificationContext/helpers';
export var getIconByVerificationStatus = function (verificationStatus) {
    switch (verificationStatus) {
        case VerificationStatus.VALID:
            return VerificationValidIcon;
        case VerificationStatus.INVALID:
            return VerificationInvalidIcon;
        case VerificationStatus.OUTDATED:
            return VerificationOutdatedIcon;
        case VerificationStatus.MAYBE:
        case VerificationStatus.ACCEPT_ALL:
            return VerificationMaybeIcon;
        default:
            return EmptyStub;
    }
};
export var getTooltipTitleByVerificationStatus = function (_a) {
    var status = _a.status, lastVerifiedTime = _a.lastVerifiedTime, verificationType = _a.verificationType;
    var attributeLabel = verificationType === InputVerificationAttribute.Email ? i18n.text('email') : i18n.text('phone number');
    var date = i18n.date(lastVerifiedTime, 'L LTS');
    switch (status) {
        case VerificationStatus.VALID:
            return i18n.text('The ${attributeLabel} is valid. Last verified on ${date}', {
                attributeLabel: attributeLabel,
                date: date
            });
        case VerificationStatus.INVALID:
            return i18n.text('The ${attributeLabel} is invalid. Last verified on ${date}', {
                attributeLabel: attributeLabel,
                date: date
            });
        case VerificationStatus.OUTDATED:
            return i18n.text('The verification for this has expired. It was valid when last verified on ${date}', {
                date: date
            });
        case VerificationStatus.MAYBE:
            return i18n.text('The ${attributeLabel} may be invalid. Last verified on ${date}', {
                attributeLabel: attributeLabel,
                date: date
            });
        case VerificationStatus.ACCEPT_ALL:
            return i18n.text('The ${attributeLabel} may be valid. Last verified on ${date}', {
                attributeLabel: attributeLabel,
                date: date
            });
        default:
            return null;
    }
};
