"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = exports.Portal = void 0;

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

var _classnames = _interopRequireDefault(require("classnames"));

var _reactDom = _interopRequireDefault(require("react-dom"));

var _jsxRuntime = require("react/jsx-runtime");

// Generated with util/create-component.js
const globalDocument = typeof document === "undefined" ? undefined : document;

const Portal = props => {
  const {
    id,
    visible = false,
    children,
    className,
    ...otherProps
  } = props;
  if (!visible || !globalDocument) return null;
  return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    id: id,
    "data-testid": "Wps-Portal",
    className: (0, _classnames.default)("Wps-Portal", className),
    ...otherProps,
    children: children
  }), document.body);
};

exports.Portal = Portal;
var _default = Portal;
exports.default = _default;