"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = require("react");
var Utilities_1 = require("../../Utilities");
var Image_1 = require("../../Image");
var DocumentCard_scss_1 = require("./DocumentCard.scss");
var DocumentCardActivity = (function (_super) {
    __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', DocumentCard_scss_1.default.activity, (_b = {},
                    _b['ms-DocumentCardActivity--multiplePeople ' + DocumentCard_scss_1.default.activityIsMultiplePeople] = people.length > 1,
                    _b)) },
                this._renderAvatars(people),
                React.createElement("div", { className: Utilities_1.css('ms-DocumentCardActivity-details', DocumentCard_scss_1.default.activityDetails) },
                    React.createElement("span", { className: Utilities_1.css('ms-DocumentCardActivity-name', DocumentCard_scss_1.default.name) }, this._getNameString(people)),
                    React.createElement("span", { className: Utilities_1.css('ms-DocumentCardActivity-activity', DocumentCard_scss_1.default.activityActivity) }, activity))));
        var _b;
    };
    DocumentCardActivity.prototype._renderAvatars = function (people) {
        return (React.createElement("div", { className: Utilities_1.css('ms-DocumentCardActivity-avatars', DocumentCard_scss_1.default.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', DocumentCard_scss_1.default.avatar) },
            person.initials && (React.createElement("div", { className: Utilities_1.css('ms-Persona-initials', DocumentCard_scss_1.default.avatarInitials), role: 'presentation' }, person.initials)),
            person.profileImageSrc && (React.createElement(Image_1.Image, { src: person.profileImageSrc, role: 'presentation', alt: '' }))));
    };
    DocumentCardActivity.prototype._getNameString = function (people) {
        var nameString = people[0].name;
        if (people.length >= 2) {
            nameString += ' +' + (people.length - 1);
        }
        return nameString;
    };
    return DocumentCardActivity;
}(React.Component));
exports.DocumentCardActivity = DocumentCardActivity;

//# sourceMappingURL=DocumentCardActivity.js.map
