* tidy: refactor text
* tidy: refactor text
* fix display of vaults table
* feat: added unstyled select
* tidy: useToggle
* tidy: useToggle
* add vaults to types
* MP-2344: first unstyled version of Select
* fix: fixed the build
* MP-2344: progress on the Select
* MP-2344: almost finished the Select
* implement basic vault modal (no logic)
* 🍱 max + displaycur for token input
* Convert to BN for TokenInputs
* env: update wallet-connector
* fix: fixed build errors and relative imports
* fix: updated TokenInput
* tidy: format
* fix: BN instead of new BigNumber
---------
Co-authored-by: Linkie Link <linkielink.dev@gmail.com>
38 lines
867 B
TypeScript
38 lines
867 B
TypeScript
import { Suspense } from 'react'
|
|
|
|
import Card from 'components/Card'
|
|
import { VaultTable } from 'components/Earn/vault/VaultTable'
|
|
import Text from 'components/Text'
|
|
import { VAULTS } from 'constants/vaults'
|
|
import { getVaults } from 'utils/api'
|
|
|
|
async function Content() {
|
|
const vaults = await getVaults()
|
|
|
|
if (!vaults.length) return null
|
|
|
|
return <VaultTable data={vaults} />
|
|
}
|
|
|
|
export default function AvailableVaults() {
|
|
return (
|
|
<Card title='Available vaults' className='mb-4 h-fit w-full bg-white/5'>
|
|
<Suspense fallback={<Fallback />}>
|
|
{/* @ts-expect-error Server Component */}
|
|
<Content />
|
|
</Suspense>
|
|
</Card>
|
|
)
|
|
}
|
|
|
|
function Fallback() {
|
|
// TODO: Replace with loading state of vaulttable
|
|
return (
|
|
<>
|
|
{VAULTS.map((vault) => (
|
|
<Text key={vault.address}>{vault.name}</Text>
|
|
))}
|
|
</>
|
|
)
|
|
}
|