"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var ProductCategoryDropdownItem_1 = require("./ProductCategoryDropdownItem");
function ProductCategoryDropdown(_a) {
    var activeFilterExpression = _a.activeFilterExpression, categories = _a.categories, level = _a.level, onFilterExpressionChange = _a.onFilterExpressionChange, parentId = _a.parentId;
    var topLvlCategories = categories
        .filter(function (i) { return i.parentID === parentId; })
        .sort(function (a, b) { return (a.name > b.name ? 1 : -1); });
    if (!topLvlCategories.length)
        return null;
    return (React.createElement(React.Fragment, null, topLvlCategories.map(function (category) {
        return React.createElement(ProductCategoryDropdownItem_1.default, { key: "categoryDropdownItem-".concat(category.id), activeFilterExpression: activeFilterExpression, categories: categories, category: category, level: level, onFilterExpressionChange: onFilterExpressionChange, parentId: parentId });
    })));
}
exports.default = ProductCategoryDropdown;
//# sourceMappingURL=ProductCategoryDropdown.js.map