"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormPageLayout = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const classNames_1 = require("../../components/utils/classNames");
const Form_1 = require("../Form");
const FormPageLayoutBase_1 = require("../FormPageLayoutBase");
const FormPageFooter_1 = require("./FormPageFooter");
const styles_1 = require("./styles");
/**
 * FormPageLayout предназначен для построения страниц с формами.
 */
const FormPageLayout = (props) => {
    const { form, children, ...restProps } = props;
    const { secondaryActions, submitButtonText, ...restFormProps } = form;
    return ((0, jsx_runtime_1.jsx)(FormPageLayoutBase_1.FormPageLayoutBase, { ...restProps, formProps: { ...form, secondaryActions }, contentClassname: (0, classNames_1.classNames)({
            [FormPageLayoutBase_1.formPageContentClassnames.formPageContentSecondaryActions]: Boolean(secondaryActions),
        }), children: ({ isDisabled }) => ((0, jsx_runtime_1.jsxs)(Form_1.Form, { ...restFormProps, isDisabled: isDisabled, children: [(0, jsx_runtime_1.jsx)(styles_1.FormContent, { children: children }), (0, jsx_runtime_1.jsx)(FormPageFooter_1.FormPageFooter, { isDisabled: isDisabled, submitButtonText: submitButtonText, secondaryActions: secondaryActions })] })) }));
};
exports.FormPageLayout = FormPageLayout;
