import { JupiterProvider } from '@jup-ag/react-hook' import { useEffect } from 'react' import useMangoStore from '../stores/useMangoStore' import PageBodyContainer from '../components/PageBodyContainer' import TopBar from '../components/TopBar' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' import { actionsSelector, connectionSelector } from '../stores/selectors' import JupiterForm from '../components/JupiterForm' import { zeroKey } from '@blockworks-foundation/mango-client' import { useTranslation } from 'next-i18next' import { useWallet } from '@solana/wallet-adapter-react' export async function getStaticProps({ locale }) { return { props: { ...(await serverSideTranslations(locale, ['common', 'swap', 'profile'])), // Will be passed to the page component as props }, } } export default function Swap() { const { t } = useTranslation(['common', 'swap']) const connection = useMangoStore(connectionSelector) const { connected, publicKey, wallet } = useWallet() const actions = useMangoStore(actionsSelector) useEffect(() => { if (wallet && connected) { actions.fetchWalletTokens(wallet) } }, [connected, actions]) if (!connection) return null const userPublicKey = publicKey && !zeroKey.equals(publicKey) ? publicKey : undefined return (

{t('swap')}

{t('swap:swap-between-hundreds')}

Powered by Jupiter
) }