"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const components_1 = require("@bluebase/components");
const react_1 = tslib_1.__importDefault(require("react"));
const helpers_1 = require("../../helpers");
const core_1 = require("@bluebase/core");
exports.ScreenView = (_a) => {
    var { children, route, Layout } = _a, rest = tslib_1.__rest(_a, ["children", "route", "Layout"]);
    const BB = core_1.useBlueBase();
    const ScreenComponent = helpers_1.resolveScreenComponent(route, BB);
    return (react_1.default.createElement(Layout, Object.assign({ Screen: ScreenComponent }, rest), children));
};
exports.ScreenView.defaultProps = {
    Layout: components_1.Noop,
};
