"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _isEmpty = _interopRequireDefault(require("lodash/fp/isEmpty"));
var _radioWithTitle = _interopRequireDefault(require("../../atom/radio-with-title"));
var _selectMultiple = _interopRequireDefault(require("../select-multiple"));
var _inputFileDraggable = _interopRequireDefault(require("../../atom/input-file-draggable"));
var _types = _interopRequireDefault(require("./types"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const getContainerStyle = (field, childType) => {
  return childType === 'massive-upload' && (field.loading || (0, _isEmpty.default)(field.previewContent)) ? _style.default.containerUpload : _style.default.container;
};
const buildInput = (childType, field) => {
  return childType === 'select-multiple' ? /*#__PURE__*/_react.default.createElement(_selectMultiple.default, field) : /*#__PURE__*/_react.default.createElement("div", {
    className: field.loading || (0, _isEmpty.default)(field.previewContent) ? _style.default.containerImageUpload : ''
  }, /*#__PURE__*/_react.default.createElement(_inputFileDraggable.default, field));
};
const TitleRadioWrapper = props => {
  const {
    radioWithTitle,
    field,
    childType
  } = props;
  return /*#__PURE__*/_react.default.createElement("div", {
    className: getContainerStyle(field, childType)
  }, radioWithTitle ? /*#__PURE__*/_react.default.createElement(_radioWithTitle.default, radioWithTitle) : null, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.field
  }, buildInput(childType, field)));
};
TitleRadioWrapper.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
var _default = exports.default = TitleRadioWrapper;
//# sourceMappingURL=index.js.map