import Button from '@components/shared/Button' import Loading from '@components/shared/Loading' import SecondaryConnectButton from '@components/shared/SecondaryConnectButton' import { useWallet } from '@solana/wallet-adapter-react' import useIpAddress from 'hooks/useIpAddress' import useMangoAccount from 'hooks/useMangoAccount' import mangoStore from '@store/mangoStore' import { useTranslation } from 'react-i18next' const TradeformSubmitButton = ({ disabled, placingOrder, setShowCreateAccountModal, sideNames, tooMuchSize, isForceReduceOnly, isSanctioned, }: { disabled: boolean placingOrder: boolean setShowCreateAccountModal: (show: boolean) => void setShowDepositModal: (show: boolean) => void sideNames: string[] tooMuchSize: boolean useMargin: boolean isForceReduceOnly: boolean isSanctioned: boolean }) => { const { t } = useTranslation(['common', 'swap', 'trade']) const side = mangoStore((s) => s.tradeForm.side) const themeData = mangoStore((s) => s.themeData) const { connected } = useWallet() const { initialLoad: mangoAccountLoading, mangoAccountAddress } = useMangoAccount() const { ipCountry } = useIpAddress() return !isSanctioned || isForceReduceOnly ? ( (connected && mangoAccountLoading) || mangoAccountAddress ? ( ) : connected && !mangoAccountAddress ? (
) : ( ) ) : ( ) } export default TradeformSubmitButton