"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useSectionRegistry = void 0;
const react_1 = require("react");
const ArticleRectContext_1 = require("../../provider/ArticleRectContext");
const useSectionRegistry = (sectionId, el) => {
    const articleRectObserver = (0, react_1.useContext)(ArticleRectContext_1.ArticleRectContext);
    (0, react_1.useEffect)(() => {
        if (!el || !articleRectObserver)
            return;
        return articleRectObserver.register(el, sectionId);
    }, [el, articleRectObserver]);
};
exports.useSectionRegistry = useSectionRegistry;
