"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = useBlockControlsFill;
var _groups = _interopRequireDefault(require("./groups"));
var _context = require("../block-edit/context");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function useBlockControlsFill(group, shareWithChildBlocks) {
  const context = (0, _context.useBlockEditContext)();
  if (context[_context.mayDisplayControlsKey]) {
    return _groups.default[group]?.Fill;
  }
  if (context[_context.mayDisplayParentControlsKey] && shareWithChildBlocks) {
    return _groups.default.parent.Fill;
  }
  return null;
}
//# sourceMappingURL=hook.js.map