import { useWallet } from '@solana/wallet-adapter-react' import { useState } from 'react' import Button from './shared/Button' import DepositModal from './DepositModal' import WithdrawModal from './WithdrawModal' import mangoStore from '../store/state' const AccountActions = () => { const { connected } = useWallet() const [showDepositModal, setShowDepositModal] = useState(false) const [showWithdrawModal, setShowWithdrawModal] = useState(false) const handleCloseMangoAccount = async () => { const client = mangoStore.getState().client const mangoAccount = mangoStore.getState().mangoAccount const group = mangoStore.getState().group if (!mangoAccount || !group) return try { const tx = await client.closeMangoAccount(group, mangoAccount) console.log('success:', tx) } catch (e) { console.log(e) } } return ( <>
{showDepositModal ? ( setShowDepositModal(false)} /> ) : null} {showWithdrawModal ? ( setShowWithdrawModal(false)} /> ) : null} ) } export default AccountActions