import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { ConfirmAction, } from '../../../../ConfirmAction';
import { StyledButton } from './styles';
export const MobileMainButton = ({ action, isDisabled, onActionClick, }) => {
    const { mobileProps, name, icon, needConfirm, confirmText, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, ...actions } = action;
    const { text, color } = mobileProps ?? { text: name, color: 'primary' };
    const renderButton = (renderProps) => (_jsx(StyledButton, { disabled: isDisabled || disabled, loading: loading, color: color, ...actions, variant: "contained", ...renderProps, children: text }));
    return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
            onClick: onActionClick(onClick),
        })) }));
};
