define(["require", "exports", "tslib", "react", "../../Utilities", "../../Persona", "./DocumentCard.scss"], function (require, exports, tslib_1, React, Utilities_1, Persona_1, stylesImport) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var styles = stylesImport;
    var DocumentCardActivity = (function (_super) {
        tslib_1.__extends(DocumentCardActivity, _super);
        function DocumentCardActivity() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DocumentCardActivity.prototype.render = function () {
            var _a = this.props, activity = _a.activity, people = _a.people;
            return (people && people.length > 0 &&
                (React.createElement("div", { className: Utilities_1.css('ms-DocumentCardActivity', styles.activity, (_b = {},
                        _b['ms-DocumentCardActivity--multiplePeople ' + styles.activityIsMultiplePeople] = people.length > 1,
                        _b)) },
                    this._renderAvatars(people),
                    React.createElement("div", { className: Utilities_1.css('ms-DocumentCardActivity-details', styles.activityDetails) },
                        React.createElement("span", { className: Utilities_1.css('ms-DocumentCardActivity-name', styles.name) }, this._getNameString(people)),
                        React.createElement("span", { className: Utilities_1.css('ms-DocumentCardActivity-activity', styles.activityActivity) }, activity)))));
            var _b;
        };
        DocumentCardActivity.prototype._renderAvatars = function (people) {
            return (React.createElement("div", { className: Utilities_1.css('ms-DocumentCardActivity-avatars', styles.avatars) },
                people.length > 1 ? this._renderAvatar(people[1]) : null,
                this._renderAvatar(people[0])));
        };
        DocumentCardActivity.prototype._renderAvatar = function (person) {
            return (React.createElement("div", { className: Utilities_1.css('ms-DocumentCardActivity-avatar', styles.avatar) },
                React.createElement(Persona_1.Persona, { imageInitials: person.initials, primaryText: person.name, hidePersonaDetails: true, imageUrl: person.profileImageSrc, initialsColor: person.initialsColor, role: 'persentation', size: Persona_1.PersonaSize.extraSmall })));
        };
        DocumentCardActivity.prototype._getNameString = function (people) {
            var nameString = people[0].name;
            if (people.length >= 2) {
                nameString += ' +' + (people.length - 1);
            }
            return nameString;
        };
        return DocumentCardActivity;
    }(Utilities_1.BaseComponent));
    exports.DocumentCardActivity = DocumentCardActivity;
});
//# sourceMappingURL=DocumentCardActivity.js.map