"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useItemDimensions = void 0;
const sdk_1 = require("@cntrl-site/sdk");
const useKeyframeValue_1 = require("../common/useKeyframeValue");
const useLayoutContext_1 = require("./useLayoutContext");
const useItemDimensions = (item, sectionId) => {
    const layoutId = (0, useLayoutContext_1.useLayoutContext)();
    const dimensions = (0, useKeyframeValue_1.useKeyframeValue)(item, sdk_1.KeyframeType.Dimensions, (item, layoutId) => layoutId ? item.area[layoutId] : undefined, (animator, scroll, value) => value ? animator.getDimensions(value, scroll) : undefined, sectionId, [layoutId]);
    return dimensions;
};
exports.useItemDimensions = useItemDimensions;
