"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useElementHover = void 0;
var _react = require("react");
/*
 * Copyright OpenSearch Contributors
 * SPDX-License-Identifier: Apache-2.0
 */

const useElementHover = () => {
  const [isHovered, setIsHovered] = (0, _react.useState)(false);
  const onMouseEnter = (0, _react.useCallback)(_event => setIsHovered(true), []);
  const onMouseLeave = (0, _react.useCallback)(_event => setIsHovered(false), []);
  return {
    isHovered,
    onMouseEnter,
    onMouseLeave
  };
};
exports.useElementHover = useElementHover;