import { jsx as _jsx } from "react/jsx-runtime";
import { Button } from '../../components/Button';
import { useFormContext } from '../useFormContext';
/**
 * Используется для форм, отображает состояние загрузки, когда форма isSubmitting
 */
export const FormSubmitButton = ({ children, loading, ...props }) => {
    const { formState } = useFormContext();
    return (_jsx(Button, { type: "submit", loading: loading || formState?.isSubmitting, ...props, children: children }));
};
