"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
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.HeaderListingContainer = void 0;
var react_1 = __importDefault(require("react"));
var react_native_1 = require("react-native");
var _ = __importStar(require("lodash"));
var styled_components_1 = require("styled-components");
var services_1 = require("../../../../services");
var NavigationBar_1 = require("../../../NavigationBar");
var native_1 = require("../../../Tabs/native");
function HeaderListingContainer(props) {
    var _a;
    var onClickHeaderBtn = props.onClickHeaderBtn, tabs = props.tabs, tabsRef = props.tabsRef, navActions = props.navActions, scrollListingRef = props.scrollListingRef;
    var title = props.title, _b = props.textResourceSingular, textResourceSingular = _b === void 0 ? 'resultado' : _b, _c = props.textResourcePlural, textResourcePlural = _c === void 0 ? 'resultados' : _c, viewList = props.viewList;
    var resourcesTotal = viewList.resourcesTotal, searching = viewList.searching, starting = viewList.starting;
    var titlePage = title ||
        services_1.NumberFormat(resourcesTotal, 0) + " " + (resourcesTotal === 1 ? textResourceSingular : textResourcePlural) + " " + (resourcesTotal === 1 ? 'encontrado' : 'encontrados');
    var theme = styled_components_1.useTheme();
    if (theme) {
        theme.tabs = ((_a = theme === null || theme === void 0 ? void 0 : theme.PageListing) === null || _a === void 0 ? void 0 : _a.tabs) || {};
        theme.tabs.backgroundActiveColor = '#fff';
        theme.tabs.textActiveColor = '#000';
    }
    return react_1.default.createElement(HeaderListingContainerRender, { titlePage: titlePage, tabs: tabs, theme: theme, tabsRef: tabsRef });
}
exports.HeaderListingContainer = HeaderListingContainer;
var HeaderListingContainerRender = react_1.default.memo(function HeaderListingContainerRender(_a) {
    var titlePage = _a.titlePage, tabs = _a.tabs, _b = _a.theme, theme = _b === void 0 ? {} : _b, tabsRef = _a.tabsRef;
    return (react_1.default.createElement(react_native_1.View, { style: { backgroundColor: '#000' } },
        react_1.default.createElement(NavigationBar_1.NavigationBar, { title: titlePage }),
        tabs && (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
            react_1.default.createElement(react_native_1.View, null,
                react_1.default.createElement(native_1.Tabs, __assign({}, tabs, { ref: tabsRef })))))));
}, _.isEqual);
//# sourceMappingURL=HeaderListingContainer.js.map