import EvStation from '@mui/icons-material/EvStation' import { type BoxProps, Typography } from '@mui/material' import { useTranslation } from 'react-i18next' import { formatUnits } from 'viem' import type { GasSufficiency } from '../../hooks/useGasSufficiency.js' import { AlertMessage } from './AlertMessage.js' interface GasSufficiencyMessageProps extends BoxProps { insufficientGas?: GasSufficiency[] } export const GasSufficiencyMessage: React.FC = ({ insufficientGas, ...props }) => { const { t } = useTranslation() return ( } title={ {t('warning.title.insufficientGas')} } {...props} > {t('warning.message.insufficientGas')} {insufficientGas?.map((item, index) => ( {t('main.tokenOnChainAmount', { amount: formatUnits( item.insufficientAmount ?? 0n, item.token.decimals ), tokenSymbol: item.token.symbol, chainName: item.chain?.name, })} ))} ) }