/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-6b06f3c
 * Released under the MIT license.
 */

import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { useProviderProps } from '../../../../provider.js';
import { Button } from '../../../actions/index.js';
import { useFormProps } from '../Form.js';
function SubmitButton(props, ref) {
    const providerProps = useProviderProps({});
    props = useFormProps(props);
    const { isDisabled: isContextDisabled } = providerProps;
    props = useFormProps(props);
    const { form, isDisabled, ...otherProps } = props;
    const isSomethingDisabled = isDisabled || isContextDisabled;
    return (_jsx(Button, { ref: ref, type: "primary", htmlType: "submit", isLoading: form?.isSubmitting, isDisabled: isSomethingDisabled ? true : form?.isInvalid, ...otherProps }));
}
const _SubmitButton = forwardRef(SubmitButton);
_SubmitButton.displayName = 'SubmitButton';
export { _SubmitButton as SubmitButton };

        