"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = useNavigateToEntityRecord;
var _router = require("@wordpress/router");
var _element = require("@wordpress/element");
var _lockUnlock = require("../../lock-unlock");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const {
  useHistory
} = (0, _lockUnlock.unlock)(_router.privateApis);
function useNavigateToEntityRecord() {
  const history = useHistory();
  const onNavigateToEntityRecord = (0, _element.useCallback)(params => {
    history.navigate(`/${params.postType}/${params.postId}?canvas=edit&focusMode=true`);
  }, [history]);
  return onNavigateToEntityRecord;
}
//# sourceMappingURL=use-navigate-to-entity-record.js.map