import $i18n from '../../../../locales/i18n.js';
import React from 'react';
import isNil from 'lodash/isNil';
import './total-info.scss';
export function TotalInfo(props) {
    var _a;
    const { tableInfo } = props;
    const { showSelectedNum, selectKeys, selectedCountInCurrentView, total, totalSlot } = tableInfo || {};
    if (totalSlot) {
        return React.createElement(React.Fragment, null, totalSlot);
    }
    return (React.createElement("span", { className: "cn-table-toolbar-left__select" },
        showSelectedNum ? (React.createElement(React.Fragment, null,
            $i18n.get({ id: 'Selected', dm: '选中' }),
            React.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.get({ id: 'Item', dm: '项' }))) : null,
        showSelectedNum && !isNil(total) ? (React.createElement("span", { className: "cn-table-toolbar-highlight" }, "/")) : null,
        !isNil(total) ? (React.createElement(React.Fragment, null,
            $i18n.get({ id: 'Total', dm: '共' }),
            React.createElement("span", { className: "cn-table-toolbar-all" }, total),
            $i18n.get({ id: 'Item', dm: '项' }))) : null));
}
