"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.topIcons = exports.menu = exports.components = void 0;
const entries_1 = require("./search/entries");
const misc_1 = require("@cocalc/util/misc");
exports.components = {};
exports.menu = {};
function register(opts) {
    let { path, title, icon, desc, Component, danger, search } = opts;
    const [main, sub] = path.split("/");
    if (!title) {
        title = (0, misc_1.capitalize)(sub);
    }
    if (!desc) {
        desc = '';
    }
    if (exports.components[main] == null) {
        exports.components[main] = { [sub]: Component };
    }
    else {
        exports.components[main][sub] = Component;
    }
    if (desc || search) {
        (0, entries_1.register)({ path, title, desc, icon, search });
    }
    if (exports.menu[main] == null) {
        exports.menu[main] = {};
    }
    exports.menu[main][sub] = { title, icon, desc, danger };
}
exports.default = register;
exports.topIcons = {
    search: "search",
    account: "user",
    editor: "edit",
    system: "gear",
    licenses: "key",
    purchases: "credit-card",
    support: "support",
};
//# sourceMappingURL=register.js.map