"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const core_1 = require("@bluebase/core");
const components_1 = require("@bluebase/components");
const react_1 = tslib_1.__importDefault(require("react"));
// const BottomNavigation = getComponent('BottomNavigation');
const TabBar = core_1.getComponent('TabBar');
exports.TabView = (props) => {
    const { screen: Screen, navigationOptions, navigator, styles } = props, rest = tslib_1.__rest(props, ["screen", "navigationOptions", "navigator", "styles"]);
    const stylesheet = styles;
    const bottomNavigation = (navigator.type === 'bottom-navigation') ? true : false;
    return (react_1.default.createElement(components_1.View, { style: stylesheet.root },
        !bottomNavigation && react_1.default.createElement(TabBar, Object.assign({ bottomNavigation: bottomNavigation }, props)),
        react_1.default.createElement(components_1.View, { style: stylesheet.content }, Screen ? react_1.default.createElement(Screen, Object.assign({}, rest)) : rest.children),
        bottomNavigation && react_1.default.createElement(TabBar, Object.assign({ bottomNavigation: bottomNavigation }, props))));
};
exports.TabView.defaultStyles = (theme) => ({
    content: {
        flex: 1,
    },
    root: {
        backgroundColor: theme.palette.background.default,
        flex: 1,
    }
});
