import React from 'react';
import isEmpty from 'lodash/fp/isEmpty';
import RadioWithTitle from '../../atom/radio-with-title';
import SelectMultiple from '../select-multiple';
import InputFileDraggable from '../../atom/input-file-draggable';
import propTypes from './types';
import style from './style.css';
const getContainerStyle = (field, childType) => {
  return childType === 'massive-upload' && (field.loading || isEmpty(field.previewContent)) ? style.containerUpload : style.container;
};
const buildInput = (childType, field) => {
  return childType === 'select-multiple' ? /*#__PURE__*/React.createElement(SelectMultiple, field) : /*#__PURE__*/React.createElement("div", {
    className: field.loading || isEmpty(field.previewContent) ? style.containerImageUpload : ''
  }, /*#__PURE__*/React.createElement(InputFileDraggable, field));
};
const TitleRadioWrapper = props => {
  const {
    radioWithTitle,
    field,
    childType
  } = props;
  return /*#__PURE__*/React.createElement("div", {
    className: getContainerStyle(field, childType)
  }, radioWithTitle ? /*#__PURE__*/React.createElement(RadioWithTitle, radioWithTitle) : null, /*#__PURE__*/React.createElement("div", {
    className: style.field
  }, buildInput(childType, field)));
};
TitleRadioWrapper.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
export default TitleRadioWrapper;
//# sourceMappingURL=index.js.map