"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
exports.useHover = function () {
    var _a = tslib_1.__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 = exports.useHover();
    return props.children(hoverResult);
};
Hoverable.displayName = "Hoverable";
exports.default = Hoverable;
