"use strict";

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

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

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

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

var _core = require("../core");

var _EventListener = _interopRequireDefault(require("../event/EventListener"));

/**
 * The glTF model primitive displays a 3D glTF model
 * created from a 3D modeling program or downloaded from the web.
 *
 * @see https://aframe.io/docs/1.3.0/primitives/a-gltf-model.html
 *
 * @example
 * ```tsx
 * <Scene>
 *   <Assets>
 *     <AssetItem id="tree" src="tree.gltf" />
 *   </Assets>
 *
 *   // Using the asset management system.
 *   <GLTFModel src="#tree" />
 *
 *   // Defining the URL inline.
 *   // Not recommended but more comfortable for web developers.
 *   <GLTFModel src="tree.gltf" />
 * </Scene>
 * ```
 */
var GLTFModel = function GLTFModel(props) {
  var src = props.src,
      children = props.children;
  return /*#__PURE__*/_react.default.createElement(_EventListener.default, (0, _extends2.default)({
    primitive: "a-gltf-model"
  }, (0, _core.toProps)(props), {
    src: src
  }), children);
};

exports.GLTFModel = GLTFModel;