"use strict";
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;
const 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; } });
const customize_2 = require("lib/customize");
const link_1 = __importDefault(require("next/link"));
function Customize({ value, children, }) {
    if (!value.shareServer) {
        return (0, jsx_runtime_1.jsx)(ShareServerIsDisabled, { value: value });
    }
    return (0, jsx_runtime_1.jsx)(customize_2.Customize, { value: value, children: children });
}
exports.Customize = Customize;
function ShareServerIsDisabled({ value }) {
    const { siteName, helpEmail } = value;
    return ((0, jsx_runtime_1.jsxs)("div", { 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, { href: "/", children: (0, jsx_runtime_1.jsx)("a", { children: siteName ?? "this server" }) }), "."] }), (0, jsx_runtime_1.jsx)("br", {}), helpEmail && ((0, jsx_runtime_1.jsxs)("div", { children: ["Contact ", (0, jsx_runtime_1.jsx)("a", { href: `mailto:${helpEmail}`, children: helpEmail }), " for help."] }))] }));
}
//# sourceMappingURL=customize.js.map