"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TotalInfo = TotalInfo;
const i18n_1 = __importDefault(require("../../../../locales/i18n.js"));
const react_1 = __importDefault(require("react"));
const isNil_1 = __importDefault(require("lodash/isNil"));
require("./total-info.scss");
function TotalInfo(props) {
    var _a;
    const { tableInfo } = props;
    const { showSelectedNum, selectKeys, selectedCountInCurrentView, total, totalSlot } = tableInfo || {};
    if (totalSlot) {
        return react_1.default.createElement(react_1.default.Fragment, null, totalSlot);
    }
    return (react_1.default.createElement("span", { className: "cn-table-toolbar-left__select" },
        showSelectedNum ? (react_1.default.createElement(react_1.default.Fragment, null,
            i18n_1.default.get({ id: 'Selected', dm: '选中' }),
            react_1.default.createElement("span", { className: "cn-table-toolbar-highlight" }, selectedCountInCurrentView != null
                ? selectedCountInCurrentView
                : ((_a = selectKeys === null || selectKeys === void 0 ? void 0 : selectKeys.length) !== null && _a !== void 0 ? _a : 0)),
            i18n_1.default.get({ id: 'Item', dm: '项' }))) : null,
        showSelectedNum && !(0, isNil_1.default)(total) ? (react_1.default.createElement("span", { className: "cn-table-toolbar-highlight" }, "/")) : null,
        !(0, isNil_1.default)(total) ? (react_1.default.createElement(react_1.default.Fragment, null,
            i18n_1.default.get({ id: 'Total', dm: '共' }),
            react_1.default.createElement("span", { className: "cn-table-toolbar-all" }, total),
            i18n_1.default.get({ id: 'Item', dm: '项' }))) : null));
}
