import _extends from "@babel/runtime/helpers/esm/extends";
import React from 'react';
import { toProps } from '../core';
import EventListener from '../event/EventListener';

function toCursorProps(_ref) {
  var far = _ref.far,
      fuse = _ref.fuse,
      fuseTimeout = _ref.fuseTimeout,
      interval = _ref.interval,
      objects = _ref.objects;
  return {
    far: far,
    fuse: fuse,
    'fuse-timeout': fuseTimeout,
    interval: interval,
    objects: objects
  };
}
/**
 * The cursor primitive is a reticle that allows for clicking and
 * basic interactivity with a scene on devices that do not have a hand controller.
 * The default appearance is a ring geometry. The cursor is usually placed as a child of the camera.
 *
 * Read the [cursor component documentation](https://aframe.io/docs/1.3.0/components/cursor.html) for detailed information about how the cursor works and how to use the cursor.
 *
 * @see https://aframe.io/docs/1.3.0/primitives/a-cursor.html
 *
 * @example
 * ```tsx
 * <Scene>
 *   <Camera>
 *     <Cursor />
 *   </Camera>
 *   <Box />
 * </Scene>
 * ```
 */


export var Cursor = function Cursor(props) {
  var cursorKeys = ['far', 'fuse', 'fuseTimeout', 'interval', 'objects'];
  var children = props.children;
  return /*#__PURE__*/React.createElement(EventListener, _extends({
    primitive: "a-cursor"
  }, toProps(props, cursorKeys), toCursorProps(props)), children);
};