import { Box, Button } from '@biom3/react'; import { useTranslation } from 'react-i18next'; import { swapButtonBoxStyle, swapButtonIconLoadingStyle, } from './SwapButtonStyles'; export interface SwapButtonProps { loading: boolean validator: () => boolean sendTransaction: () => Promise; } export function SwapButton({ loading, validator, sendTransaction, }: SwapButtonProps) { const { t } = useTranslation(); const handleClick = async () => { const canSwap = validator(); if (canSwap) { await sendTransaction(); } }; return ( ); }