"use strict";

var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
  return mod && mod.__esModule ? mod : {
    "default": mod
  };
};

Object.defineProperty(exports, "__esModule", {
  value: true
});

var react_1 = require("react");

var useKey_1 = __importDefault(require("react-use/lib/useKey"));

var useRegistInputEnterEvent = function useRegistInputEnterEvent(inputRef, onPressEnter) {
  var keyFilter = react_1.useCallback(function (event) {
    return event.key === 'Enter' && event.target === inputRef.current;
  }, [inputRef]);
  useKey_1["default"](keyFilter, onPressEnter, undefined, [onPressEnter]);
};

exports["default"] = useRegistInputEnterEvent;

