import { __read } from "tslib";
import * as React from "react";
export var useHover = function () {
    var _a = __read(React.useState(false), 2), hovering = _a[0], setHovering = _a[1];
    var handleEnter = function () {
        setHovering(true);
    };
    var handleLeave = function () {
        setHovering(false);
    };
    return {
        hovering: hovering,
        onMouseOver: handleEnter,
        onMouseLeave: handleLeave,
        onTouchStart: handleEnter,
        onTouchEnd: handleLeave,
    };
};
var Hoverable = function (props) {
    var hoverResult = useHover();
    return props.children(hoverResult);
};
Hoverable.displayName = "Hoverable";
export default Hoverable;
