"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const Context_1 = require("../../Context");
const react_1 = tslib_1.__importDefault(require("react"));
const __1 = require("../../");
const utils_1 = require("../../utils");
/**
 * Main SystemApp. This is the component that renders content to the screen.
 */
class SystemApp extends react_1.default.PureComponent {
    render() {
        const BB = this.context;
        const _a = this.props, { children } = _a, rest = tslib_1.__rest(_a, ["children"]);
        if (children) {
            return utils_1.renderChildrenWithProps(children, { BB });
        }
        const SystemHeader = BB.Components.resolve('SystemHeader');
        const SystemContent = BB.Components.resolve('SystemContent');
        const SystemFooter = BB.Components.resolve('SystemFooter');
        return (react_1.default.createElement(__1.View, Object.assign({}, rest),
            react_1.default.createElement(SystemHeader, null),
            react_1.default.createElement(SystemContent, null),
            react_1.default.createElement(SystemFooter, null)));
    }
}
SystemApp.contextType = Context_1.BlueBaseContext;
exports.SystemApp = SystemApp;
