diff --git a/components/Account/AccountStatus.tsx b/components/Account/AccountStatus.tsx new file mode 100644 index 00000000..eec5ff66 --- /dev/null +++ b/components/Account/AccountStatus.tsx @@ -0,0 +1,80 @@ +import BigNumber from 'bignumber.js' + +import { BorrowCapacity } from 'components/BorrowCapacity' +import Button from 'components/Button' +import FormattedNumber from 'components/FormattedNumber' +import Gauge from 'components/Gauge' +import Text from 'components/Text' +import useAccountStats from 'hooks/useAccountStats' +import useCreditAccounts from 'hooks/useCreditAccounts' +import { chain } from 'utils/chains' +import { formatValue } from 'utils/formatters' + +interface Props { + createCreditAccount: () => void +} + +const AccountStatus = ({ createCreditAccount }: Props) => { + const accountStats = useAccountStats() + const { data: creditAccountsList, isLoading: isLoadingCreditAccounts } = useCreditAccounts() + const hasCreditAccounts = creditAccountsList && creditAccountsList.length > 0 + + if (!hasCreditAccounts) { + return ( + + ) + } + + return ( +
Loading...
+ ) : ( + <> +