"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.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FiltersContainer = void 0;
var react_1 = __importStar(require("react"));
var Modal_1 = require("../../Modal");
var ScreenMedia_1 = require("../../ScreenMedia");
var PageListingContext_1 = require("../PageListingContext");
var S = __importStar(require("./FiltersContainer.style"));
var FiltersContainer = function FiltersComponent(props) {
    var pageListing = react_1.useContext(PageListingContext_1.PageListingContext);
    return (react_1.default.createElement(S.FiltersContainerStyle, null,
        react_1.default.createElement(FiltersDesktop, { FiltersComponent: props.filterComponent, handleFilters: pageListing.updateFilters, clearFilters: pageListing.clearFilters, filters: pageListing.filters }),
        react_1.default.createElement(FiltersMobile, { FiltersComponent: props.filterComponent, handleFilters: pageListing.updateFiltersDebounce, closeFilters: pageListing.closeFilters, filters: pageListing.filters, filterMobileOpen: pageListing.filterMobileOpen })));
};
exports.FiltersContainer = FiltersContainer;
var FiltersDesktop = function FiltersDesktop(props) {
    var FiltersComponent = props.FiltersComponent;
    return (react_1.default.createElement(ScreenMedia_1.ScreenMedia, { showIn: "desktop" },
        react_1.default.createElement("div", { className: "filters" },
            react_1.default.createElement("div", { className: "filters-content", "data-cy": "desktop-filters" },
                react_1.default.createElement(FiltersComponent, { handleFilters: props.handleFilters, filters: props.filters })))));
};
function FiltersMobile(_a) {
    var filterMobileOpen = _a.filterMobileOpen, FiltersComponent = _a.FiltersComponent, handleFilters = _a.handleFilters, filters = _a.filters;
    return (react_1.default.createElement(ScreenMedia_1.ScreenMedia, { size: "mobile" },
        react_1.default.createElement(Modal_1.Modal, { show: filterMobileOpen, animation: "slideDown" },
            react_1.default.createElement(S.FiltersMobileStyle, null,
                react_1.default.createElement(FiltersComponent, { handleFilters: handleFilters, filters: filters })))));
}
//# sourceMappingURL=FiltersContainer.js.map