infinity-forge
Version:
19 lines • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useSection = useSection;
var context_1 = require("../context.js");
function useSection(_a) {
var _b, _c;
var ref = _a.ref, refSection = _a.refSection;
var dynamicSectionsPageProps = (0, context_1.useAtena)().dynamicSectionsPageProps;
var obj = dynamicSectionsPageProps === null || dynamicSectionsPageProps === void 0 ? void 0 : dynamicSectionsPageProps[ref];
var debug = (_b = dynamicSectionsPageProps === null || dynamicSectionsPageProps === void 0 ? void 0 : dynamicSectionsPageProps['sections']) === null || _b === void 0 ? void 0 : _b.map(function (s) { return s.ref; });
return {
debug: debug,
item: obj,
page: obj,
pagination: obj,
section: (_c = dynamicSectionsPageProps === null || dynamicSectionsPageProps === void 0 ? void 0 : dynamicSectionsPageProps['sections']) === null || _c === void 0 ? void 0 : _c.find(function (section) { return (section === null || section === void 0 ? void 0 : section.ref) === refSection; }),
};
}
//# sourceMappingURL=index.js.map