UNPKG

@unito/integration-debugger

Version:

The Unito Integration Debugger

39 lines (38 loc) 2.18 kB
"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"); const react_1 = require("react"); const store_1 = require("./store"); const help_1 = __importDefault(require("./windows/help")); const debugger_1 = __importDefault(require("./windows/debugger")); const process_1 = __importDefault(require("./windows/process")); const header_1 = __importDefault(require("./windows/header")); const configuration_1 = __importDefault(require("./windows/configuration")); const configurationWatcher_1 = __importDefault(require("./configurationWatcher")); const statusWatcher_1 = __importDefault(require("./statusWatcher")); const App = (props) => { const window = (0, store_1.useWindowState)(); // Application-wide key mapping. (0, react_1.useEffect)(() => { props.screen.key(['d'], function () { window.current = store_1.Window.debugger; }); props.screen.key(['0'], function () { window.current = store_1.Window.process; }); props.screen.key(['i'], function () { window.current = store_1.Window.config; }); props.screen.key(['h'], function () { window.current = store_1.Window.help; }); props.screen.key(['q', 'C-c'], function () { process.exit(0); }); }, []); return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(configurationWatcher_1.default, { configuration: props.configuration }), (0, jsx_runtime_1.jsx)(statusWatcher_1.default, {}), (0, jsx_runtime_1.jsx)(header_1.default, {}), window.current === store_1.Window.debugger && (0, jsx_runtime_1.jsx)(debugger_1.default, {}), window.current === store_1.Window.process && (0, jsx_runtime_1.jsx)(process_1.default, {}), window.current === store_1.Window.config && (0, jsx_runtime_1.jsx)(configuration_1.default, {}), window.current === store_1.Window.help && (0, jsx_runtime_1.jsx)(help_1.default, {})] })); }; exports.default = App;