"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 core_1 = require("@bluebase/core");
function getTitle(options = {}, tabBarOptions = {}, focused) {
    const label = options.tabBarLabel || options.title || options.headerTitle;
    if (!tabBarOptions.showLabel || !label) {
        return;
    }
    const tintColor = focused ? tabBarOptions.activeTintColor : tabBarOptions.inactiveTintColor;
    if (typeof label === 'function') {
        return label({ focused, tintColor });
    }
    return react_1.default.createElement(components_1.Text, { style: Object.assign({ color: tintColor }, tabBarOptions.labelStyle) }, label);
}
exports.getTitle = getTitle;
function getIcon(options = {}, tabBarOptions = {}, focused) {
    const icon = options.tabBarIcon;
    if (!tabBarOptions.showIcon || !icon) {
        return;
    }
    if (typeof icon === 'function') {
        return icon({
            focused,
            horizontal: !core_1.isMobile(),
            tintColor: focused ? tabBarOptions.activeTintColor : tabBarOptions.inactiveTintColor,
        });
    }
    if (icon && typeof icon.type === 'string') {
        return icon;
    }
}
exports.getIcon = getIcon;
