"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MatchRulesTooltip = void 0;
var react_1 = __importDefault(require("react"));
var NegativeRuleTooltipIcon_1 = __importDefault(require("../icons/NegativeRuleTooltipIcon"));
var styles_1 = require("./styles");
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var MatchRulesTooltip = function (_a) {
    var _b = _a.isMlMatch, isMlMatch = _b === void 0 ? false : _b, matchRules = _a.matchRules;
    var styles = (0, styles_1.useStyles)();
    var hasMatchRules = matchRules.length > 0;
    var showTitle = !isMlMatch && hasMatchRules;
    return (react_1.default.createElement("div", { className: styles.container },
        react_1.default.createElement("div", { className: showTitle ? styles.bodyWithMargin : styles.bodyWithoutMargin },
            showTitle && react_1.default.createElement("div", { className: styles.title }, ui_i18n_1.default.text('Match rules')),
            hasMatchRules
                ? matchRules.map(function (match) { return (react_1.default.createElement("div", { key: match.uri },
                    '- ',
                    match.negativeRule && react_1.default.createElement(NegativeRuleTooltipIcon_1.default, { className: styles.negativeRuleIcon }),
                    match.label)); })
                : null)));
};
exports.MatchRulesTooltip = MatchRulesTooltip;
