"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useScrollToAttribute = void 0;
var react_1 = require("react");
var styles_1 = require("./styles");
var useScrollToAttribute = function (context) {
    var styles = (0, styles_1.useStyles)();
    var ref = (0, react_1.useRef)(null);
    (0, react_1.useEffect)(function () {
        if (context) {
            context.scrollIntoRef(ref);
        }
    }, [context]);
    return context ? { ref: ref, highlightedClassName: styles.highlighted } : { ref: ref };
};
exports.useScrollToAttribute = useScrollToAttribute;
