"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = require("react");
const useHover = (onHover) => {
    const [isHover, setHover] = (0, react_1.useState)(false);
    const [isActive, setActive] = (0, react_1.useState)(false);
    const handleMouseOver = (0, react_1.useCallback)((e) => {
        // if (!isDragging()) {
        setHover(true);
        if (onHover) {
            onHover(e);
        }
        // }
    }, []);
    const handleMouseOut = (0, react_1.useCallback)(() => setHover(false), []);
    const handleDown = (0, react_1.useCallback)(() => setActive(true), []);
    const handleUp = (0, react_1.useCallback)(() => setActive(false), []);
    return [
        {
            onMouseDown: handleDown,
            onMouseUp: handleUp,
            onMouseEnter: handleMouseOver,
            onMouseLeave: handleMouseOut,
            //  onDragStart: handleMouseOut,
        },
        isHover,
        isActive,
    ];
};
exports.default = useHover;
//# sourceMappingURL=useGraphHover.js.map