"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _InformationItem = _interopRequireDefault(require("./MaterialUI/DataDisplay/PredefinedElements/InformationItem"));
var _sharedMessages = _interopRequireDefault(require("../sharedMessages"));
var _reactIntl = require("react-intl");
var _Box = _interopRequireDefault(require("@material-ui/core/Box"));
var _styles = require("@material-ui/core/styles");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var useStyles = (0, _styles.makeStyles)(function (theme) {
  return {
    registry: {
      "& > div + div": {
        marginTop: theme.spacing(2)
      }
    }
  };
});
var Registry = function Registry(_ref) {
  var dateCreated = _ref.dateCreated,
    createdBy = _ref.createdBy,
    lastModifiedDate = _ref.lastModifiedDate,
    lastModifiedBy = _ref.lastModifiedBy,
    _ref$additionalConten = _ref.additionalContent,
    additionalContent = _ref$additionalConten === void 0 ? [] : _ref$additionalConten;
  var _useIntl = (0, _reactIntl.useIntl)(),
    formatDate = _useIntl.formatDate;
  var classes = useStyles();
  var created = formatDate(dateCreated);
  var lastModified = formatDate(lastModifiedDate);
  0;
  var registry = /*#__PURE__*/_react.default.createElement(_Box.default, {
    className: classes.registry,
    display: "flex",
    flexDirection: "column"
  }, dateCreated !== undefined && /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
    label: _sharedMessages.default.created,
    children: created
  }), createdBy !== undefined && /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
    label: _sharedMessages.default.createdBy,
    children: createdBy
  }), lastModifiedDate !== undefined && /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
    label: _sharedMessages.default.lastModified,
    children: lastModified
  }), lastModifiedBy !== undefined && /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
    label: _sharedMessages.default.lastModifiedBy,
    children: lastModifiedBy
  }), additionalContent.map(function (c, index) {
    return /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
      key: "additional" + index,
      label: c.label,
      children: c.content
    });
  }));
  return registry;
};
__signature__(Registry, "useIntl{{ formatDate }}\nuseStyles{classes}", function () {
  return [_reactIntl.useIntl, useStyles];
});
__signature__(Registry, "useIntl{{ formatDate }}\nuseStyles{classes}", function () {
  return [_reactIntl.useIntl, useStyles];
});
var _default = Registry;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/Registry.js");
  reactHotLoader.register(Registry, "Registry", "/home/vsts/work/1/s/src/components/Registry.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Registry.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/Registry.js");
  reactHotLoader.register(Registry, "Registry", "/home/vsts/work/1/s/src/components/Registry.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Registry.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();