import { isNil } from "lodash-es";
import React, { Children } from "react";
import { isElement } from "react-is";
import { DefaultTooltip } from "../components/DefaultTooltip/DefaultTooltip.js";
function useTooltipTemplate(children, layerType) {
  let template = void 0;
  Children.forEach(children, (child) => {
    if (isElement(child) && child.type === layerType) {
      const defaultTooltipHandler = (closestPoint, layerData) => /* @__PURE__ */ React.createElement(DefaultTooltip, { closestPoint, layerData });
      template = isNil(child.props.children) ? defaultTooltipHandler : child.props.children;
    }
  });
  return template;
}
export {
  useTooltipTemplate
};
//# sourceMappingURL=use-tooltip-template.js.map
