"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PageLayoutSectionContainer = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const PageContext_1 = require("../../PageContext");
const classNames_1 = require("../../utils/classNames");
const constants_1 = require("./constants");
const styles_1 = require("./styles");
/**
 * Контейнер для секций страницы.
 *
 * @example
 * <PageLayout content={
 *   <PageLayoutSectionContainer>
 *     <PageLayoutSection>
 *           Секция 1
 *     </PageLayoutSection>
 *   </PageLayoutSectionContainer>
 * } />
 */
const PageLayoutSectionContainer = ({ children, className, isShowDivider = false, }) => {
    const { hasAside } = (0, react_1.useContext)(PageContext_1.PageContext);
    const classes = (0, react_1.useMemo)(() => {
        return (0, classNames_1.classNames)(className, {
            [constants_1.pageLayoutSectionContainerClassnames.withAside]: hasAside,
            [constants_1.pageLayoutSectionContainerClassnames.withDivider]: isShowDivider,
        });
    }, [className, hasAside, isShowDivider]);
    return (0, jsx_runtime_1.jsx)(styles_1.SectionContainer, { className: classes, children: children });
};
exports.PageLayoutSectionContainer = PageLayoutSectionContainer;
