import { jsx as _jsx } from "react/jsx-runtime";
import { Box, Collapse } from '@mui/material';
import { useFundsSufficiency, useGasSufficiency } from '../../hooks';
import { useWidgetConfig } from '../../providers';
import { FundsSufficiencyMessage } from './FundsSufficiencyMessage';
import { GasSufficiencyMessage } from './GasSufficiencyMessage';
export const GasMessage = ({ route, ...props }) => {
    const { insufficientGas } = useGasSufficiency(route);
    const { insufficientFunds } = useFundsSufficiency(route);
    const { sdkConfig } = useWidgetConfig();
    const isMultisigSigner = sdkConfig?.multisigConfig?.isMultisigSigner;
    const validInsufficientGas = insufficientGas?.length && !isMultisigSigner;
    return (_jsx(Collapse, { timeout: 225, in: Boolean(insufficientFunds || validInsufficientGas), unmountOnExit: true, mountOnEnter: true, children: _jsx(Box, { ...props, children: insufficientFunds ? (_jsx(FundsSufficiencyMessage, {})) : validInsufficientGas ? (_jsx(GasSufficiencyMessage, { insufficientGas: insufficientGas })) : null }) }));
};
