"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 });
exports.Customize = exports.useCustomize = void 0;
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 customize_1 = require("lib/customize");
Object.defineProperty(exports, "useCustomize", { enumerable: true, get: function () { return customize_1.useCustomize; } });
var customize_2 = require("lib/customize");
var link_1 = __importDefault(require("next/link"));
function Customize(_a) {
    var value = _a.value, children = _a.children;
    if (!value.shareServer) {
        return (0, jsx_runtime_1.jsx)(ShareServerIsDisabled, { value: value });
    }
    return (0, jsx_runtime_1.jsx)(customize_2.Customize, __assign({ value: value }, { children: children }));
}
exports.Customize = Customize;
function ShareServerIsDisabled(_a) {
    var value = _a.value;
    var siteName = value.siteName, helpEmail = value.helpEmail;
    return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: { margin: "30px", fontSize: "12pt" } }, { children: [(0, jsx_runtime_1.jsxs)("h1", { children: ["Browsing of publicly shared paths is currently disabled on", " ", (0, jsx_runtime_1.jsx)(link_1.default, __assign({ href: "/" }, { children: (0, jsx_runtime_1.jsx)("a", { children: siteName !== null && siteName !== void 0 ? siteName : "this server" }) })), "."] }), (0, jsx_runtime_1.jsx)("br", {}), helpEmail && ((0, jsx_runtime_1.jsxs)("div", { children: ["Contact ", (0, jsx_runtime_1.jsx)("a", __assign({ href: "mailto:".concat(helpEmail) }, { children: helpEmail })), " for help."] }))] })));
}
//# sourceMappingURL=customize.js.map