"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 © 2022 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
const react_1 = require("react");
const path_1 = require("path");
const head_1 = __importDefault(require("next/head"));
const footer_1 = __importDefault(require("components/landing/footer"));
const header_1 = __importDefault(require("components/landing/header"));
const antd_1 = require("antd");
const base_path_1 = __importDefault(require("lib/base-path"));
const icon_1 = require("@cocalc/frontend/components/icon");
const theme_1 = require("@cocalc/util/theme");
const post_1 = __importDefault(require("lib/api/post"));
const config_1 = require("lib/config");
const favicon = (0, path_1.join)(base_path_1.default, "webapp/favicon-32x32.png");
function Custom404() {
    const [siteName, setSiteName] = (0, react_1.useState)("");
    (0, react_1.useEffect)(() => {
        (async () => {
            const customize = await (0, post_1.default)("customize", { fields: ["siteName"] });
            setSiteName(customize.siteName);
        })();
    }, []);
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(head_1.default, { children: [(0, jsx_runtime_1.jsxs)("title", { children: [siteName ? `${siteName}  – ` : "", "404 Page Not Found"] }), (0, jsx_runtime_1.jsx)("meta", { name: "description", content: "404 Page Not Found" }), (0, jsx_runtime_1.jsx)("meta", { name: "robots", content: "noindex,nofollow" }), (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: favicon })] }), (0, jsx_runtime_1.jsxs)(antd_1.Layout, { children: [(0, jsx_runtime_1.jsx)(header_1.default, {}), (0, jsx_runtime_1.jsx)(antd_1.Layout.Content, { style: { background: "white" }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
                                color: "#555",
                                margin: "50px auto",
                                minHeight: "50vh",
                                maxWidth: config_1.MAX_WIDTH,
                                fontSize: "150%",
                            }, children: [(0, jsx_runtime_1.jsxs)("h1", { children: ["404 \u2013 Page Not Found", (0, jsx_runtime_1.jsx)("span", { style: {
                                                float: "right",
                                                fontSize: "200%",
                                                color: theme_1.COLORS.ANTD_RED,
                                            }, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "robot" }) })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("a", { href: `${base_path_1.default}/`, children: ["Back to ", siteName ? `${siteName}'s ` : "the ", " main page"] }) })] }) }), (0, jsx_runtime_1.jsx)(footer_1.default, {})] })] }));
}
exports.default = Custom404;
//# sourceMappingURL=404.js.map