"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormSubmitButton = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const Button_1 = require("../../components/Button");
const useFormContext_1 = require("../useFormContext");
/**
 * Используется для форм, отображает состояние загрузки, когда форма isSubmitting
 */
const FormSubmitButton = ({ children, loading, ...props }) => {
    const { formState } = (0, useFormContext_1.useFormContext)();
    return ((0, jsx_runtime_1.jsx)(Button_1.Button, { type: "submit", loading: loading || formState?.isSubmitting, ...props, children: children }));
};
exports.FormSubmitButton = FormSubmitButton;
