"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.addTextAndPropsToStrings = void 0;

var _react = _interopRequireDefault(require("react"));

var _index = require("../index");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const addTextAndPropsToStrings = (children, props) => {
  if (Array.isArray(children)) {
    return _react.default.Children.map(children, child => {
      if (typeof child === 'string') {
        return /*#__PURE__*/_react.default.createElement(_index.Text, props, child);
      } else {
        if (child) {
          const computedProp = { ...props,
            ...child.props
          };
          return /*#__PURE__*/_react.default.cloneElement(child, computedProp, child.props.children);
        } else {
          return child;
        }
      }
    });
  } else {
    if (typeof children === 'string') {
      return /*#__PURE__*/_react.default.createElement(_index.Text, props, children);
    } else {
      if (children) {
        const computedProp = { ...props,
          ...children.props
        };
        return /*#__PURE__*/_react.default.cloneElement(children, computedProp, children.props.children);
      } else {
        return children;
      }
    }
  }
};

exports.addTextAndPropsToStrings = addTextAndPropsToStrings;
//# sourceMappingURL=addTextAndPropsToStrings.js.map