"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
/*
 *  This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
const A_1 = __importDefault(require("components/misc/A"));
const logo_rectangular_1 = __importDefault(require("components/logo-rectangular"));
const antd_1 = require("antd");
const customize_1 = require("lib/customize");
const contact_1 = __importDefault(require("./contact"));
function Item({ first, children, }) {
    if (first)
        return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u00A0", " – ", "\u00A0", children] }));
}
function Footer() {
    const { siteName, organizationName, organizationURL, termsOfServiceURL, contactEmail, landingPages, imprint, onCoCalcCom, isCommercial, imprintOrPolicies, } = (0, customize_1.useCustomize)();
    function organization() {
        if (organizationURL) {
            return (0, jsx_runtime_1.jsx)(A_1.default, { href: organizationURL, children: organizationName });
        }
        else {
            return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: organizationName });
        }
    }
    function renderOrganization() {
        if (!organizationName)
            return null;
        return (0, jsx_runtime_1.jsx)(Item, { children: organization() });
    }
    return ((0, jsx_runtime_1.jsxs)(antd_1.Layout.Footer, { style: {
            textAlign: "center",
            borderTop: "1px solid lightgrey",
            backgroundColor: "white",
        }, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Item, { first: true, children: siteName ?? "CoCalc" }), onCoCalcCom && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://about.cocalc.com/", children: "About" }) })), renderOrganization(), !landingPages && termsOfServiceURL && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: termsOfServiceURL, children: "Terms of Service" }) })), contactEmail && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(contact_1.default, { showEmail: false }) })), imprint && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "/policies/imprint", children: "Imprint" }) })), (landingPages || imprintOrPolicies) && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "/policies", children: "Policies" }) })), isCommercial && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "/pricing", children: "Products and Pricing" }) })), landingPages && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "/software", children: "Software" }) })), (0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "/info/status", children: "Status" }) })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(logo_rectangular_1.default, { style: { height: "40px", width: "40px" } }) })] }));
}
exports.default = Footer;
//# sourceMappingURL=footer.js.map