"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BottomNavigationAction = void 0;
const tslib_1 = require("tslib");
const components_1 = require("@bluebase/components");
const BottomNavigationAction_1 = tslib_1.__importDefault(require("@material-ui/core/BottomNavigationAction"));
const react_1 = tslib_1.__importDefault(require("react"));
const react_native_1 = require("react-native");
const component_mapper_1 = require("@bluebase/component-mapper");
const lodash_get_1 = tslib_1.__importDefault(require("lodash.get"));
const helpers_1 = require("../../helpers");
exports.BottomNavigationAction = component_mapper_1.componentMapper(BottomNavigationAction_1.default, {
    icon: (p) => {
        const { icon } = p;
        if (!icon) {
            return;
        }
        if (react_1.default.isValidElement(icon)) {
            return icon;
        }
        const size = lodash_get_1.default(icon, 'size', 24);
        const props = Object.assign({ size, style: Object.assign(Object.assign({}, lodash_get_1.default(p, 'styles.icon', {})), icon.style) }, icon);
        return react_1.default.createElement(components_1.DynamicIcon, props);
    },
    style: ({ style }) => react_native_1.StyleSheet.flatten(style),
    label: 'label',
    showLabel: 'showLabel',
    value: 'value',
}, { rest: true });
exports.BottomNavigationAction.defaultStyles = (theme, { selected }) => ({
    icon: {
        color: helpers_1.or(!selected, theme.palette.text.secondary, theme.palette.primary.main),
    },
});
