"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTooltipTitleByVerificationStatus = exports.getIconByVerificationStatus = void 0;
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var EmptyStub_1 = require("../EmptyStub");
var VerificationInvalidIcon_1 = __importDefault(require("../icons/VerificationInvalidIcon"));
var VerificationValidIcon_1 = __importDefault(require("../icons/VerificationValidIcon"));
var VerificationOutdatedIcon_1 = __importDefault(require("../icons/VerificationOutdatedIcon"));
var VerificationMaybeIcon_1 = __importDefault(require("../icons/VerificationMaybeIcon"));
var helpers_1 = require("../contexts/AttributesVerificationContext/helpers");
var getIconByVerificationStatus = function (verificationStatus) {
    switch (verificationStatus) {
        case helpers_1.VerificationStatus.VALID:
            return VerificationValidIcon_1.default;
        case helpers_1.VerificationStatus.INVALID:
            return VerificationInvalidIcon_1.default;
        case helpers_1.VerificationStatus.OUTDATED:
            return VerificationOutdatedIcon_1.default;
        case helpers_1.VerificationStatus.MAYBE:
        case helpers_1.VerificationStatus.ACCEPT_ALL:
            return VerificationMaybeIcon_1.default;
        default:
            return EmptyStub_1.EmptyStub;
    }
};
exports.getIconByVerificationStatus = getIconByVerificationStatus;
var getTooltipTitleByVerificationStatus = function (_a) {
    var status = _a.status, lastVerifiedTime = _a.lastVerifiedTime, verificationType = _a.verificationType;
    var attributeLabel = verificationType === mdm_sdk_1.InputVerificationAttribute.Email ? ui_i18n_1.default.text('email') : ui_i18n_1.default.text('phone number');
    var date = ui_i18n_1.default.date(lastVerifiedTime, 'L LTS');
    switch (status) {
        case helpers_1.VerificationStatus.VALID:
            return ui_i18n_1.default.text('The ${attributeLabel} is valid. Last verified on ${date}', {
                attributeLabel: attributeLabel,
                date: date
            });
        case helpers_1.VerificationStatus.INVALID:
            return ui_i18n_1.default.text('The ${attributeLabel} is invalid. Last verified on ${date}', {
                attributeLabel: attributeLabel,
                date: date
            });
        case helpers_1.VerificationStatus.OUTDATED:
            return ui_i18n_1.default.text('The verification for this has expired. It was valid when last verified on ${date}', {
                date: date
            });
        case helpers_1.VerificationStatus.MAYBE:
            return ui_i18n_1.default.text('The ${attributeLabel} may be invalid. Last verified on ${date}', {
                attributeLabel: attributeLabel,
                date: date
            });
        case helpers_1.VerificationStatus.ACCEPT_ALL:
            return ui_i18n_1.default.text('The ${attributeLabel} may be valid. Last verified on ${date}', {
                attributeLabel: attributeLabel,
                date: date
            });
        default:
            return null;
    }
};
exports.getTooltipTitleByVerificationStatus = getTooltipTitleByVerificationStatus;
