import React, { useMemo } from "react";
import { Notifications, NotificationsModuleInit } from "./components/Notifications/notifications";
import { Auth, AuthModuleInit } from "./components/Auth/auth";
import { Build, BuildCommands } from "./components/Build/build";
import { BodyContainer } from "./components/Body/body";
import { AppRoute } from "./routes/AppRoute/app.route";
import { AdminRoute } from "./routes/AdminRoute/admin.route";
import { SettingsRoute } from "./routes/SettingsRoute/settings.route";
import { Types } from "./types/types";
import { AdminTable, AdminList } from "./routes/AdminRoute/admin.table";
import { SettingsTable, SettingsList } from "./routes/SettingsRoute/settings.table";
import { Icons } from "v-eris";
import "./app.scss";
import EN from "./lang/en";
import ENTest from "./lang/en.test";
import RU from "./lang/ru";
var Languages = {
    "ru": RU,
    "en": EN,
};
export var App = function () {
    var adminSections = useMemo(function () {
        var table = BuildCommands.joinTable(AdminTable, {
            Filesystem2: [{
                    key: "Main", title: "Filesystem2", icon: React.createElement(Icons.fileempty, null),
                    list: [
                        { key: "save", type: "button", mini: 1, params: { title: "save" } },
                    ],
                }],
        });
        var list = BuildCommands.joinList(AdminList, [
            { key: "Applications", list: [
                    { title: "Admin::Module::Filesystem2", key: "Filesystem2", route: "filesystem", icon: React.createElement(Icons.enter, null) },
                ] },
        ]);
        return { table: table, list: list };
    }, []);
    var settingsSections = useMemo(function () {
        var table = BuildCommands.joinTable(SettingsTable, {
            Lang2: [{
                    title: "Settings::Module::Language", key: "Lang2",
                    list: [
                        { key: "CurrentLanguage", title: "General::Language::CurrentLanguage", desc: "General::Language::CurrentLanguage::Desc", type: "select",
                            value: "en",
                            button: "General::Language::CurrentLanguage::Button",
                            params: [
                                { title: "General::Language::CurrentLanguage::ru", value: "ru" },
                                { title: "General::Language::CurrentLanguage::en", value: "en" },
                                { title: "General::Language::CurrentLanguage::kz", value: "kz" }
                            ]
                        },
                    ]
                },],
        });
        var list = BuildCommands.joinList(SettingsList, [
            { title: "Settings::Module::Appearance", key: "Appearance", icon: React.createElement(Icons.image, null), list: [
                    { title: "Settings::Module::Lang2", key: "Lang2", icon: React.createElement(Icons.command, null) },
                ] }
        ]);
        return { table: table, list: list };
    }, []);
    return React.createElement("div", null,
        React.createElement(Build, { languages: {
                "ru": BuildCommands.joinLang(Languages.ru, {}),
                "en": BuildCommands.joinLang(Languages.en, ENTest),
            }, modules: [
                NotificationsModuleInit,
                AuthModuleInit
            ], types: BuildCommands.joinTypes(Types, {}), settingsTable: settingsSections.table, routes: {
                "app": { icon: React.createElement(Icons.earth, null), access: 3, title: "App", element: (React.createElement(AppRoute, null)) },
                "admin": { icon: React.createElement(Icons.users, null), access: 9, title: "Admin", element: React.createElement(AdminRoute, null), list: adminSections.list, table: adminSections.table },
                "settings": { icon: React.createElement(Icons.cog, null), access: 5, title: "Settings", element: React.createElement(SettingsRoute, null), list: settingsSections.list, table: settingsSections.table },
            } },
            React.createElement(Notifications, { container: true }),
            React.createElement(Auth, null),
            React.createElement(BodyContainer, null)));
};
//# sourceMappingURL=app.js.map