"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var Persona_1 = require("../../Persona");
var PersonaCoin_1 = require("../../PersonaCoin");
var stylesImport = require("./DocumentCard.scss");
var styles = stylesImport;
var DocumentCardActivity = /** @class */ (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;
        if (!people || people.length === 0) {
            return null;
        }
        return (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(PersonaCoin_1.PersonaCoin, { imageInitials: person.initials, text: person.name, imageUrl: person.profileImageSrc, initialsColor: person.initialsColor, allowPhoneInitials: person.allowPhoneInitials, role: 'presentation', size: Persona_1.PersonaSize.size32 })));
    };
    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