import { __assign, __extends } from "tslib";
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import cn from 'classnames';
import Icon from '../../../icon';
import AbstractTrigger from '../AbstractTrigger';
var NormalUploadTrigger = (function (_super) {
    __extends(NormalUploadTrigger, _super);
    function NormalUploadTrigger() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    NormalUploadTrigger.prototype.renderFileItemCount = function () {
        var _a = this.props, fileList = _a.fileList, maxAmount = _a.maxAmount;
        if (maxAmount === Infinity) {
            return null;
        }
        return (_jsxs("span", __assign({ className: "zent-file-upload-trigger-text-count", "data-zv": 'v10.0.12' }, { children: [(fileList === null || fileList === void 0 ? void 0 : fileList.length) || 0, "/", maxAmount] }), void 0));
    };
    NormalUploadTrigger.prototype.render = function () {
        var _a;
        var _b = this.props, i18n = _b.i18n, disabled = _b.disabled, remainAmount = _b.remainAmount;
        var isDisabled = disabled || remainAmount <= 0;
        return (_jsxs("div", __assign({ className: cn('zent-file-upload-trigger', (_a = {},
                _a['zent-file-upload-trigger__disabled'] = isDisabled,
                _a)), onClick: this.onClickTrigger, onDragOver: this.onTriggerDragOver, onDrop: this.onTriggerDrop, "data-zv": 'v10.0.12' }, { children: [_jsx(Icon, { type: "upload", className: "zent-file-upload-trigger-icon" }, void 0), _jsxs("span", __assign({ className: "zent-file-upload-trigger-text", "data-zv": 'v10.0.12' }, { children: [i18n.add, this.renderFileItemCount()] }), void 0), this.renderFileInput()] }), void 0));
    };
    return NormalUploadTrigger;
}(AbstractTrigger));
export default NormalUploadTrigger;
