"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var jsx_runtime_1 = require("react/jsx-runtime");
/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var util_1 = require("lib/share/util");
var loading_1 = __importDefault(require("components/share/loading"));
var customize_1 = require("lib/share/customize");
var public_paths_1 = __importDefault(require("components/share/public-paths"));
var layout_1 = require("components/share/layout");
var avatar_1 = __importDefault(require("components/account/avatar"));
function Account(_a) {
    var _b;
    var first_name = _a.first_name, last_name = _a.last_name, publicPaths = _a.publicPaths, customize = _a.customize, account_id = _a.account_id;
    if (first_name == null || last_name == null || publicPaths == null) {
        return (0, jsx_runtime_1.jsx)(loading_1.default, { style: { fontSize: "30px" } });
    }
    var name = (0, util_1.trunc)("".concat(first_name, " ").concat(last_name), 150);
    var client_id = (_b = customize.account) === null || _b === void 0 ? void 0 : _b.account_id;
    return ((0, jsx_runtime_1.jsx)(customize_1.Customize, __assign({ value: customize }, { children: (0, jsx_runtime_1.jsxs)(layout_1.Layout, __assign({ title: name }, { children: [(0, jsx_runtime_1.jsxs)("h1", { children: [(0, jsx_runtime_1.jsx)(avatar_1.default, { account_id: account_id }), " ", name] }), client_id == account_id ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "You are an active collaborator on projects that contain the published documents listed below. We include any unlisted or disabled published documents so that you can browse or edit them from here. This full list is only visible to you (other people only see public documents)." })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [name, " is an active collaborator on projects that contain the following public documents:"] })), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(public_paths_1.default, { publicPaths: publicPaths })] })) })));
}
exports.default = Account;
//# sourceMappingURL=account.js.map