"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppRoute = void 0;
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importStar(require("react"));
var v_eris_1 = require("v-eris");
var react_router_dom_1 = require("react-router-dom");
var build_1 = require("../../components/Build/build");
var tools_1 = require("../../components/Tools/tools");
var loader_1 = require("../../components/Loader/loader");
var tools_test_1 = require("../../components/Tools/tools.test");
var sidebar_1 = require("../../components/Sidebar/sidebar");
var search_1 = require("../../components/Search/search");
var templates_1 = require("../../components/Templates/templates");
var templates_table_1 = require("@components/Templates/templates.table");
var AppRoute = function () {
    var nav = (0, react_router_dom_1.useNavigate)();
    var location = (0, react_router_dom_1.useLocation)();
    var qs = v_eris_1.Common.parseQuery(location);
    var build = (0, react_1.useContext)(build_1.BuildContext);
    var route = build.routes["admin"];
    var settings = build.settings;
    var _a = (0, react_1.useState)({}), tools = _a[0], setToolsRef = _a[1];
    var _b = (0, react_1.useState)(true), sidebarActive = _b[0], setSidebarActive = _b[1];
    var setTools = function (data) {
        var _a;
        console.log(data);
        setToolsRef(tslib_1.__assign(tslib_1.__assign({}, tools), (_a = {}, _a[data.key] = data.value, _a)));
    };
    var templatesList = {
        "aircrafts": [
            { list: [1, 2, 3] }
        ],
    };
    return (react_1.default.createElement(v_eris_1.Row, { style: { height: "100%" } },
        react_1.default.createElement(search_1.Search, { active: sidebarActive }),
        react_1.default.createElement(sidebar_1.Sidebar, { active: sidebarActive, hasSearch: true, onClick: function () { console.log(sidebarActive); setSidebarActive(!sidebarActive); } },
            react_1.default.createElement(templates_1.Templates, { templates: templates_table_1.TemplatesTable, value: templatesList })),
        react_1.default.createElement(v_eris_1.Overlay, { margin: [70, 19], direction: [1, 1], style: { zIndex: 2 } },
            react_1.default.createElement(v_eris_1.Row, { gap: 12 },
                react_1.default.createElement(tools_1.Tools, { list: tools_test_1.MeasurementsTools, simple: true, value: tools, onChange: setTools, cycle: settings.getSecureValue("Measurements:Settings:SwitchType") == "cycle", style: { display: settings.getSecureValue("Measurements:Toggles:TopBar") != "never" ? "flex" : "none" } }),
                react_1.default.createElement(tools_1.Tools, { list: tools_test_1.Tools1, value: tools, onChange: setTools }),
                react_1.default.createElement(tools_1.Tools, { list: tools_test_1.Tools2, value: tools, onChange: setTools }))),
        react_1.default.createElement(loader_1.Loader, { active: true, container: true })));
};
exports.AppRoute = AppRoute;
//# sourceMappingURL=app.route.js.map