"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactRedux = require("react-redux");
var _record = require("../../actions/record");
var _reducers = require("../../reducers");
var _SubrecordEditor = _interopRequireDefault(require("../../components/record/SubrecordEditor"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const mapStateToProps = (state, ownProps) => {
  const {
    containerCsid,
    name
  } = ownProps;
  const subrecordCsid = (0, _reducers.getRecordSubrecordCsid)(state, containerCsid, name);
  return {
    csid: subrecordCsid,
    data: (0, _reducers.getRecordData)(state, subrecordCsid),
    perms: (0, _reducers.getUserPerms)(state)
  };
};
const mapDispatchToProps = {
  detachSubrecord: _record.detachSubrecord
};
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_SubrecordEditor.default);
exports.default = _default;