import _map from "lodash/fp/map";
import React from 'react';
import PropTypes from 'prop-types';
import InputCheckbox from '../../atom/input-checkbox';
import Button from '../../atom/button';
import Provider from '../../atom/provider';
import style from './style.css';
const InputSplitScreen = (props, context) => {
  const {
    translate
  } = context;
  const {
    leftSection,
    rightSection,
    buttons
  } = props;
  const criteriaList = _map.convert({
    cap: false
  })((criterion, key) => {
    return /*#__PURE__*/React.createElement("div", {
      className: style.field,
      key: key
    }, /*#__PURE__*/React.createElement(InputCheckbox, criterion));
  }, leftSection.values);
  const collectionList = _map.convert({
    cap: false
  })((collection, key) => {
    return /*#__PURE__*/React.createElement("div", {
      className: style.field,
      key: key
    }, /*#__PURE__*/React.createElement(InputCheckbox, collection));
  }, rightSection.values);
  const buttonList = _map.convert({
    cap: false
  })((button, key) => {
    return /*#__PURE__*/React.createElement("div", {
      className: style.button,
      key: key
    }, /*#__PURE__*/React.createElement(Button, button));
  }, buttons);
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    className: style.splitDefault
  }, /*#__PURE__*/React.createElement("div", {
    className: style.splitLeft
  }, /*#__PURE__*/React.createElement("p", {
    className: style.title
  }, `${leftSection.title}${leftSection.required ? '*' : ''}`), criteriaList), /*#__PURE__*/React.createElement("div", {
    className: style.splitRight
  }, /*#__PURE__*/React.createElement("p", {
    className: style.title
  }, `${rightSection.title}${rightSection.required ? '*' : ''}`), collectionList)), /*#__PURE__*/React.createElement("div", {
    className: style.rowBottom
  }, /*#__PURE__*/React.createElement("div", {
    className: style.buttonGroup
  }, buttonList), /*#__PURE__*/React.createElement("p", {
    className: style.mandatoryFields
  }, translate('mandatory_fields'))));
};
const sectionPropTypes = process.env.NODE_ENV !== "production" ? {
  title: PropTypes.string.isRequired,
  values: PropTypes.arrayOf(PropTypes.shape({
    ...InputCheckbox.propTypes
  })).isRequired,
  required: PropTypes.bool
} : {};
InputSplitScreen.propTypes = process.env.NODE_ENV !== "production" ? {
  leftSection: PropTypes.shape({
    ...sectionPropTypes
  }),
  rightSection: PropTypes.shape({
    ...sectionPropTypes
  })
} : {};
InputSplitScreen.contextTypes = {
  translate: Provider.childContextTypes.translate
};
const SetupCohortItem = props => {
  const {
    field
  } = props;
  return /*#__PURE__*/React.createElement("div", {
    className: style.wrapper
  }, /*#__PURE__*/React.createElement(InputSplitScreen, field));
};
SetupCohortItem.defaultProps = {
  field: {}
};
SetupCohortItem.propTypes = process.env.NODE_ENV !== "production" ? {
  field: PropTypes.shape({
    ...InputSplitScreen.propTypes
  })
} : {};
export default SetupCohortItem;
//# sourceMappingURL=index.js.map