var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import React from 'react';
import classnames from 'classnames';
var formatMaxNumber = function (max) { return max + "+"; };
var NotificationCounter = /** @class */ (function (_super) {
    __extends(NotificationCounter, _super);
    function NotificationCounter() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    NotificationCounter.prototype.renderValue = function () {
        var _a = this.props, max = _a.max, value = _a.value, formatMaxNumber = _a.formatMaxNumber;
        if (max && value > max) {
            return formatMaxNumber(max);
        }
        return value.toString(10);
    };
    NotificationCounter.prototype.render = function () {
        var _a = this.props, testAutomationId = _a.testAutomationId, children = _a.children, className = _a.className;
        return (React.createElement("div", { "data-test-automation-id": testAutomationId, className: classnames('rc-notification-counter', className) },
            children,
            React.createElement("div", { "data-test-automation-id": "value", className: "rc-notification-counter__value" }, this.renderValue())));
    };
    NotificationCounter.defaultProps = {
        testAutomationId: 'notificationCounter',
        formatMaxNumber: formatMaxNumber,
        max: null,
        className: null
    };
    return NotificationCounter;
}(React.Component));
export { NotificationCounter };
//# sourceMappingURL=NotificationCounter.js.map