"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;

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

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

/* eslint-disable global-require */
document.head.insertAdjacentHTML('beforeend', "<style>\n    canvas.a-canvas.a-mouse-cursor-hover:hover {\n      cursor: grab;\n    }\n  </style>");

var VRArenaSSR = function VRArenaSSR(_ref) {
  var children = _ref.children;

  var _useState = (0, _react.useState)(false),
      rendered = _useState[0],
      setRendered = _useState[1];

  (0, _react.useEffect)(function () {
    setRendered(true);

    if (typeof window !== 'undefined') {
      require('aframe');
    }
  }, [setRendered]);

  if (!rendered) {
    return /*#__PURE__*/_react.default.createElement("h1", null, "loading");
  }

  return children;
};

var _default = VRArenaSSR;
exports.default = _default;