import React__default from 'react';
import ReactDOM from 'react-dom';

/**
 * Вспомогательный компонент. Используется в Popup, Popover.
 * Представляет собой ReactDOM.createPortal() в форме компонента.
 */
var Portal = function Portal(_ref) {
  var children = _ref.children,
    container = _ref.container,
    _ref$disabled = _ref.disabled,
    disabled = _ref$disabled === void 0 ? false : _ref$disabled;
  var portalContainer = typeof container === 'function' ? container() : container;
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, disabled || !portalContainer ? children : /*#__PURE__*/ReactDOM.createPortal(children, portalContainer));
};

export { Portal };
