"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const components_1 = require("@bluebase/components");
const core_1 = require("@bluebase/core");
exports.getTitle = (options = {}, focused = false) => {
    const { tabBarOptions = {} } = options;
    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, { testID: "tab-title", style: Object.assign({ color: tintColor }, tabBarOptions.labelStyle) }, label));
};
exports.getIcon = (options = {}, focused = false) => {
    const { tabBarOptions = {} } = options;
    const icon = options.tabBarIcon;
    if (!tabBarOptions.showIcon) {
        return;
    }
    const tintColor = focused ? tabBarOptions.activeTintColor : tabBarOptions.inactiveTintColor;
    if (typeof icon === 'function') {
        return icon({
            focused,
            horizontal: !core_1.isMobile(),
            tintColor,
        });
    }
    if (icon && typeof icon.type === 'string') {
        return icon;
    }
};
