require("../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_RecordBoardContext = require("../context/RecordBoardContext.js");
let react = require("react");
//#region src/components/pisellRecordBoard/hooks/useRecordBoardContext.ts
function useRecordBoardContext(options = {}) {
	const ctx = (0, react.useContext)(require_RecordBoardContext.RecordBoardContext);
	if (!ctx) throw new Error("useRecordBoardContext 必须在 PisellRecordBoard（或 RecordBoardProvider）下使用");
	const { displayName, childComponentProps } = options;
	const mergedChildProps = childComponentProps !== null && childComponentProps !== void 0 ? childComponentProps : ctx.childComponentProps;
	if (displayName && (mergedChildProps === null || mergedChildProps === void 0 ? void 0 : mergedChildProps[displayName])) return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, ctx), mergedChildProps[displayName]);
	return ctx;
}
//#endregion
exports.useRecordBoardContext = useRecordBoardContext;
