import { useCallback, useState } from 'react' import { CurrencyDollarIcon, LinkIcon } from '@heroicons/react/outline' import useMangoStore from '../stores/useMangoStore' import PageBodyContainer from '../components/PageBodyContainer' import TopBar from '../components/TopBar' import EmptyState from '../components/EmptyState' import AccountsModal from '../components/AccountsModal' import AccountBorrows from '../components/account-page/AccountBorrows' import Loading from '../components/Loading' export default function Borrow() { const [showAccountsModal, setShowAccountsModal] = useState(false) const connected = useMangoStore((s) => s.wallet.connected) const selectedMangoAccount = useMangoStore( (s) => s.selectedMangoAccount.current ) const wallet = useMangoStore((s) => s.wallet.current) const isLoading = useMangoStore((s) => s.selectedMangoAccount.initialLoad) const handleCloseAccounts = useCallback(() => { setShowAccountsModal(false) }, []) return (

Borrow Funds

Borrowed funds are withdrawn to your connected wallet.

{selectedMangoAccount ? ( ) : connected ? ( isLoading ? (
) : ( } onClickButton={() => setShowAccountsModal(true)} title="No Account Found" /> ) ) : ( } onClickButton={() => wallet.connect()} title="Connect Wallet" /> )}
{showAccountsModal ? ( ) : null}
) }