import { usePinch } from "@use-gesture/react";
import React from "react";
/**
 * 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
 */
export default function PinchHelper(_ref) {
  var children = _ref.children,
    onPinch = _ref.onPinch;
  var target = React.useRef();
  usePinch(function (arg) {
    if (onPinch) onPinch(arg);
  }, {
    target: target
  });
  return /*#__PURE__*/React.createElement("div", {
    ref: target,
    className: "tg-pinch-helper"
  }, children);
}