'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _reactRedux = require('react-redux');

var _relation = require('../../actions/relation');

var _reducers = require('../../reducers');

var _HierarchySiblingList = require('../../components/record/HierarchySiblingList');

var _HierarchySiblingList2 = _interopRequireDefault(_HierarchySiblingList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var mapStateToProps = function mapStateToProps(state, ownProps) {
  var parentCsid = ownProps.parentCsid,
      recordType = ownProps.recordType;


  var subject = {
    recordType: recordType
  };

  var object = {
    recordType: recordType,
    csid: parentCsid
  };

  return {
    findResult: (0, _reducers.getRelationFindResult)(state, subject, object, 'hasBroader')
  };
};

var mapDispatchToProps = {
  findRelations: _relation.find
};

exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_HierarchySiblingList2.default);