2022-09-06 01:30:13 +00:00
|
|
|
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
|
|
|
import { DepositsTable } from '@vegaprotocol/deposits';
|
|
|
|
import { useDeposits } from '@vegaprotocol/deposits';
|
2022-07-14 16:12:28 +00:00
|
|
|
import { t } from '@vegaprotocol/react-helpers';
|
2022-07-18 21:11:53 +00:00
|
|
|
import Link from 'next/link';
|
2022-07-14 16:12:28 +00:00
|
|
|
|
|
|
|
export const DepositsContainer = () => {
|
2022-09-06 01:30:13 +00:00
|
|
|
const { deposits, loading, error } = useDeposits();
|
|
|
|
|
2022-07-14 16:12:28 +00:00
|
|
|
return (
|
2022-09-06 01:30:13 +00:00
|
|
|
<div className="h-full grid grid-rows-[min-content_1fr]">
|
|
|
|
<header className="flex justify-between items-center p-4">
|
|
|
|
<h4 className="text-lg text-black dark:text-white">{t('Deposits')}</h4>
|
2022-07-18 21:11:53 +00:00
|
|
|
<Link href="/portfolio/deposit" passHref={true}>
|
2022-09-06 01:30:13 +00:00
|
|
|
<Button>Deposit</Button>
|
2022-07-18 21:11:53 +00:00
|
|
|
</Link>
|
2022-09-06 01:30:13 +00:00
|
|
|
</header>
|
|
|
|
<div>
|
|
|
|
<AsyncRenderer
|
|
|
|
data={deposits}
|
|
|
|
loading={loading}
|
|
|
|
error={error}
|
|
|
|
render={(data) => {
|
|
|
|
return <DepositsTable deposits={data} />;
|
|
|
|
}}
|
|
|
|
/>
|
2022-07-14 16:12:28 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|