"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandleEsc = void 0;
const react_1 = require("react");
const utils_1 = require("../../utils");
const HandleEsc = ({ onPress }) => {
    const pressed = (0, utils_1.useKeyPress)("Escape");
    (0, react_1.useEffect)(() => {
        if (pressed) {
            onPress();
        }
    }, [pressed, onPress]);
    return null;
};
exports.HandleEsc = HandleEsc;
//# sourceMappingURL=HandleEsc.js.map