"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _propTypes = _interopRequireDefault(require("prop-types"));
var _ImageItem = _interopRequireDefault(require("./ImageItem"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const styles = _reactNative.StyleSheet.create({
  row: {
    flexDirection: 'row',
    flex: 1
  }
});
class Row extends _react.PureComponent {
  constructor(props) {
    super(props);
    this.renderImage = this.renderImage.bind(this);
  }
  renderImage(item, isSelected) {
    const {
      imageMargin,
      selectedMarker,
      imagesPerRow,
      containerWidth,
      selected
    } = this.props;
    const {
      uri
    } = item.node.image;
    return /*#__PURE__*/_react.default.createElement(_ImageItem.default, {
      key: uri,
      item: item,
      selectedList: selected,
      selected: isSelected,
      imageMargin: imageMargin,
      selectedMarker: selectedMarker,
      imagesPerRow: imagesPerRow,
      containerWidth: containerWidth,
      onClick: this.props.selectImage
    });
  }
  render() {
    const items = this.props.rowData.map((item, index) => {
      if (item === null) {
        return null;
      }
      return this.renderImage(item, this.props.isSelected[index]);
    });
    return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
      style: styles.row
    }, items);
  }
}
Row.propTypes = {
  rowData: _propTypes.default.array.isRequired,
  isSelected: _propTypes.default.array.isRequired,
  selectImage: _propTypes.default.func.isRequired
};
var _default = Row;
exports.default = _default;
//# sourceMappingURL=Row.js.map