"use strict";

exports.__esModule = true;
exports["default"] = PinchHelper;
var _react = require("@use-gesture/react");
var _react2 = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
 * wrapper for the react usePinch gesture
 * @param {*} children child components to be enveloped
 * @param {*} onPinch the action to be performed when pinch gesture is registered
 */
function PinchHelper(_ref) {
  var children = _ref.children,
    onPinch = _ref.onPinch;
  var target = _react2["default"].useRef();
  (0, _react.usePinch)(function (arg) {
    if (onPinch) onPinch(arg);
  }, {
    target: target
  });
  return /*#__PURE__*/_react2["default"].createElement("div", {
    ref: target,
    className: "tg-pinch-helper"
  }, children);
}
module.exports = exports.default;