import { EvStation } from '@mui/icons-material'; import { Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; import { formatUnits } from 'viem'; import type { GasSufficiency } from '../../hooks/useGasSufficiency.js'; import { AlertMessage } from '../AlertMessage/AlertMessage.js'; interface GasSufficiencyMessageProps { insufficientGas?: GasSufficiency[]; } export const GasSufficiencyMessage: React.FC = ({ insufficientGas, }) => { const { t } = useTranslation(); return ( } title={ {t(`warning.title.insufficientGas`)} } > {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, })} ))} ); };