"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NavigationBar = void 0;
var react_1 = __importDefault(require("react"));
var react_native_responsive_fontsize_1 = require("react-native-responsive-fontsize");
var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
var react_native_fontawesome_1 = require("@fortawesome/react-native-fontawesome");
var _ = __importStar(require("lodash"));
var styled_components_1 = require("styled-components");
var TextNative_1 = require("../TextNative");
var NavigationBar_style_1 = require("./NavigationBar.style");
exports.NavigationBar = react_1.default.memo(function NavigationBar(_a) {
    var _b, _c, _d;
    var title = _a.title, _e = _a.color, color = _e === void 0 ? null : _e, _f = _a.background, background = _f === void 0 ? null : _f, goBack = _a.goBack, openMenu = _a.openMenu, _g = _a.size, size = _g === void 0 ? 'normal' : _g, _h = _a.actionsButtons, actionsButtons = _h === void 0 ? [] : _h;
    var theme = styled_components_1.useTheme();
    var fontSizeIcon = size === 'large' ? react_native_responsive_fontsize_1.RFValue(17) : react_native_responsive_fontsize_1.RFValue(15);
    var fontSizeTitle = size === 'large' ? 19 : 16;
    return (react_1.default.createElement(NavigationBar_style_1.Container, null,
        react_1.default.createElement(NavigationBar_style_1.NavBarStyle, { size: size, background: background },
            react_1.default.createElement(NavigationBar_style_1.MenuContainer, { testID: "btn-menu-drawer", onPress: function () {
                    if (goBack) {
                        goBack();
                    }
                    if (openMenu) {
                        openMenu();
                    }
                } }, goBack ? (react_1.default.createElement(react_native_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faArrowLeft, color: color || ((_b = theme === null || theme === void 0 ? void 0 : theme.navigationBar) === null || _b === void 0 ? void 0 : _b.textColor) || 'white', size: fontSizeIcon })) : (react_1.default.createElement(react_native_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faBars, color: color || ((_c = theme === null || theme === void 0 ? void 0 : theme.navigationBar) === null || _c === void 0 ? void 0 : _c.textColor) || 'white', size: fontSizeIcon }))),
            react_1.default.createElement(NavigationBar_style_1.TitleContainer, null,
                react_1.default.createElement(TextNative_1.TextNative, { color: color || ((_d = theme === null || theme === void 0 ? void 0 : theme.navigationBar) === null || _d === void 0 ? void 0 : _d.textColor) || 'white', size: fontSizeTitle, ellipsizeMode: "tail", numberOfLines: 1 }, title)),
            react_1.default.createElement(NavigationBar_style_1.ActionsRightContainer, null, actionsButtons.map(function (item, i) { return (react_1.default.createElement(NavigationBar_style_1.ActionButton, { key: "nav-action-btn-" + i, testID: "nav-action-btn-" + i, onPress: function () { return item.onPress(); } }, item.render)); })))));
}, _.isEqual);
//# sourceMappingURL=NavigationBar.js.map