import React from 'react';
import { useLocalLabels } from '@sentecacommerce-theme/lib';
import { AutocompleteFilter, CheckboxFilter, ColorFilter, DropdownSelectFilter, TextWithLinkFilter, SelectedFilters, SlideFilter } from './Components';
var filtersMap = {
  checkbox: CheckboxFilter,
  color: ColorFilter,
  autocomplete: AutocompleteFilter,
  dropdown: DropdownSelectFilter,
  'attribute-checkbox': CheckboxFilter,
  'range-checkbox': CheckboxFilter,
  'text-with-link': TextWithLinkFilter,
  'range-slider': SlideFilter
};

var EmptyFilter = () => null;

export function Aggregates(_ref) {
  var {
    data
  } = _ref;
  var labels = useLocalLabels();
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SelectedFilters, {
    isInModal: true,
    data: data
  }), data == null ? void 0 : data.map(filter => {
    var Component = /*#__PURE__*/React.memo(filtersMap[filter.component] || EmptyFilter);
    return /*#__PURE__*/React.createElement(Component, {
      key: "Aggregate__" + filter.name + "-" + filter.type,
      data: filter,
      labels: labels
    });
  }));
}
//# sourceMappingURL=index.js.map