import * as n from "react";
function e(i) {
  const o = n.useRef(""), c = n.useCallback((r) => {
    r.defaultPrevented || (o.current = r.pointerType, i(r, r.pointerType));
  }, [i]);
  return {
    onClick: n.useCallback((r) => {
      if (r.detail === 0) {
        i(r, "keyboard");
        return;
      }
      "pointerType" in r && i(r, r.pointerType), i(r, o.current), o.current = "";
    }, [i]),
    onPointerDown: c
  };
}
export {
  e as useEnhancedClickHandler
};
