"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var styled_components_1 = __importDefault(require("styled-components"));
var elements_1 = require("@joincivil/elements");
exports.ContributorsDefaultAvatarStyled = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  align-items: center;\n  background-color: ", ";\n  border: 1px solid ", ";\n  border-radius: 50%;\n  color: ", ";\n  display: flex;\n  font-family: ", ";\n  font-size: 10px;\n  height: ", ";\n  justify-content: center;\n  margin-right: 10px;\n  text-transform: uppercase;\n  width: ", ";\n"], ["\n  align-items: center;\n  background-color: ", ";\n  border: 1px solid ", ";\n  border-radius: 50%;\n  color: ", ";\n  display: flex;\n  font-family: ", ";\n  font-size: 10px;\n  height: ", ";\n  justify-content: center;\n  margin-right: 10px;\n  text-transform: uppercase;\n  width: ", ";\n"])), function (props) { return props.backgroundColor; }, elements_1.colors.basic.WHITE, elements_1.colors.basic.WHITE, elements_1.fonts.SANS_SERIF, function (props) { return props.size + "px"; }, function (props) { return props.size + "px"; });
var AvatarGenericIconStyled = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  margin-right: 10px;\n"], ["\n  margin-right: 10px;\n"])));
exports.ContributorsDefaultAvatar = function (props) {
    var avatarColors = ["#EF6B4A", "#9452B5", "#A5CE52"];
    // user has an account but no avatar
    if (props.contributor && props.contributor.payerChannel && props.contributor.payerChannel.handle) {
        var initial = props.contributor.payerChannel.handle.charAt(0);
        return (React.createElement(exports.ContributorsDefaultAvatarStyled, { backgroundColor: avatarColors[props.index], size: props.size }, initial));
    }
    // guest user, no handle
    return (React.createElement(AvatarGenericIconStyled, null,
        React.createElement(elements_1.AvatarGenericIcon, { size: props.size })));
};
var templateObject_1, templateObject_2;
//# sourceMappingURL=ContributorsDefaultAvatar.js.map