"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PageContent = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const PageLayoutFooter_1 = require("../PageLayoutFooter");
const classNames_1 = require("../utils/classNames");
const constants_1 = require("./constants");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
exports.PageContent = (0, react_1.forwardRef)((props, forwardedRef) => {
    const { hasAside, contentClassnames } = (0, useLogic_1.useLogic)(props);
    const { className, children, isFullHeight = true, footer, scrollRef, header, } = props;
    return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: (0, classNames_1.classNames)(className, constants_1.pageContentClassnames.pageContent), ref: forwardedRef, "$isFullHeight": isFullHeight, "$isSeparatorShown": hasAside || Boolean(header), children: [header && header, (0, jsx_runtime_1.jsx)(styles_1.Content, { ref: scrollRef, className: contentClassnames, "$hasAside": hasAside || Boolean(header), children: children }), footer && !(0, react_1.isValidElement)(footer) && ((0, jsx_runtime_1.jsx)(PageLayoutFooter_1.PageLayoutFooter, { ...footer })), (0, react_1.isValidElement)(footer) && footer] }));
});
