"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProfileBandNavigationWidget = void 0;
var react_1 = __importStar(require("react"));
var Link_1 = __importDefault(require("@mui/material/Link"));
var KeyboardArrowLeft_1 = __importDefault(require("@mui/icons-material/KeyboardArrowLeft"));
var KeyboardArrowRight_1 = __importDefault(require("@mui/icons-material/KeyboardArrowRight"));
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var classnames_1 = __importDefault(require("classnames"));
var ramda_1 = require("ramda");
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var LabelsContext_1 = require("../../../contexts/LabelsContext");
var withTooltip_1 = require("../../../HOCs/withTooltip");
var SmallIconButton_1 = require("../../../SmallIconButton");
var styles_1 = require("./styles");
var LinkWithTooltip = (0, withTooltip_1.withTooltip)(Link_1.default);
var ProfileBandNavigationWidget = function (_a) {
    var _b;
    var className = _a.className, _c = _a.total, total = _c === void 0 ? 0 : _c, onPrev = _a.onPrev, onNext = _a.onNext, onSearchResultsClick = _a.onSearchResultsClick, isPrevDisabled = _a.isPrevDisabled, isNextDisabled = _a.isNextDisabled;
    var styles = (0, styles_1.useStyles)();
    var labels = (0, react_1.useContext)(LabelsContext_1.LabelsContext);
    var _d = (0, ramda_1.mergeRight)({
        OPEN_RESULTS: ui_i18n_1.default.text('Go to search results'),
        SEARCH_RESULT: ui_i18n_1.default.text('Search result'),
        SEARCH_RESULTS: ui_i18n_1.default.text('Search results'),
        PREVIOUS_PROFILE: ui_i18n_1.default.text('Go to previous profile'),
        NEXT_PROFILE: ui_i18n_1.default.text('Go to next profile')
    }, (_b = labels === null || labels === void 0 ? void 0 : labels.profileBand) !== null && _b !== void 0 ? _b : {}), OPEN_RESULTS = _d.OPEN_RESULTS, SEARCH_RESULT = _d.SEARCH_RESULT, SEARCH_RESULTS = _d.SEARCH_RESULTS, NEXT_PROFILE = _d.NEXT_PROFILE, PREVIOUS_PROFILE = _d.PREVIOUS_PROFILE;
    return (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.container, className) },
        react_1.default.createElement(LinkWithTooltip, { className: styles.link, component: "button", variant: "caption", onClick: onSearchResultsClick, underline: "none", tooltipTitle: OPEN_RESULTS },
            (0, mdm_sdk_1.formatNumberAsMetric)(total, 1000000),
            " ",
            total === 1 ? SEARCH_RESULT : SEARCH_RESULTS),
        react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { size: "L", icon: KeyboardArrowLeft_1.default, "data-reltio-id": "reltio-previous-profile-button", tooltipTitle: PREVIOUS_PROFILE, onClick: onPrev, disabled: isPrevDisabled, showForDisabled: true }),
        react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { size: "L", icon: KeyboardArrowRight_1.default, "data-reltio-id": "reltio-next-profile-button", tooltipTitle: NEXT_PROFILE, onClick: onNext, disabled: isNextDisabled, showForDisabled: true })));
};
exports.ProfileBandNavigationWidget = ProfileBandNavigationWidget;
