import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef, isValidElement } from 'react';
import { PageLayoutFooter, } from '../PageLayoutFooter';
import { classNames } from '../utils/classNames';
import { pageContentClassnames } from './constants';
import { Content, Wrapper } from './styles';
import { useLogic } from './useLogic';
export const PageContent = forwardRef((props, forwardedRef) => {
    const { hasAside, contentClassnames } = useLogic(props);
    const { className, children, isFullHeight = true, footer, scrollRef, header, } = props;
    return (_jsxs(Wrapper, { className: classNames(className, pageContentClassnames.pageContent), ref: forwardedRef, "$isFullHeight": isFullHeight, "$isSeparatorShown": hasAside || Boolean(header), children: [header && header, _jsx(Content, { ref: scrollRef, className: contentClassnames, "$hasAside": hasAside || Boolean(header), children: children }), footer && !isValidElement(footer) && (_jsx(PageLayoutFooter, { ...footer })), isValidElement(footer) && footer] }));
});
