import React from 'react';
import { useCatalogFilter } from '@sentecacommerce-theme/lib';
import { CarouselComponent } from '../../Common';
import { LineItem, LineItemPlaceholder } from '../../';
var placeholderItems = Array(10).fill(null).map((_, i) => ({
  id: i,
  isPlaceholder: true
}));
export var CarouselItems = props => {
  var {
    header,
    withArrows,
    small,
    skus,
    withScrollBar
  } = props;
  var {
    data: catalogData
  } = useCatalogFilter({
    filter: "sku;in;\"" + (skus == null ? void 0 : skus.join('","')) + "\""
  });
  return /*#__PURE__*/React.createElement(CarouselComponent, {
    slides: (catalogData == null ? void 0 : catalogData.results) || placeholderItems,
    header: header,
    withArrows: withArrows,
    withScrollBar: withScrollBar,
    small: small,
    renderSlide: item => /*#__PURE__*/React.createElement(React.Fragment, null, item.isPlaceholder ? /*#__PURE__*/React.createElement(LineItemPlaceholder, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LineItem, {
      data: item,
      hideVariants: true,
      carousel: true
    })))
  });
};
//# sourceMappingURL=index.js.map