import { jsx as _jsx } from "react/jsx-runtime";
import { useContext, useMemo } from 'react';
import { PageContext } from '../../PageContext';
import { classNames } from '../../utils/classNames';
import { pageLayoutSectionContainerClassnames } from './constants';
import { SectionContainer } from './styles';
/**
 * Контейнер для секций страницы.
 *
 * @example
 * <PageLayout content={
 *   <PageLayoutSectionContainer>
 *     <PageLayoutSection>
 *           Секция 1
 *     </PageLayoutSection>
 *   </PageLayoutSectionContainer>
 * } />
 */
export const PageLayoutSectionContainer = ({ children, className, isShowDivider = false, }) => {
    const { hasAside } = useContext(PageContext);
    const classes = useMemo(() => {
        return classNames(className, {
            [pageLayoutSectionContainerClassnames.withAside]: hasAside,
            [pageLayoutSectionContainerClassnames.withDivider]: isShowDivider,
        });
    }, [className, hasAside, isShowDivider]);
    return _jsx(SectionContainer, { className: classes, children: children });
};
