feat(accounts): enrich brokerage account list
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
import type { FC } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router";
|
||||
import type { BrokerageAccount } from "@/entities/brokerage-account";
|
||||
import type { BrokerageAccountCard } from "@/entities/brokerage-account";
|
||||
import { BrokerageAccountList } from "@/entities/brokerage-account";
|
||||
import { StateView } from "@/shared/ui";
|
||||
|
||||
@@ -26,7 +26,7 @@ type AccountsPageEmptyProps = {
|
||||
};
|
||||
|
||||
type AccountsPageLoadedProps = {
|
||||
accounts: BrokerageAccount[];
|
||||
accounts: BrokerageAccountCard[];
|
||||
refreshing?: boolean;
|
||||
refreshError?: boolean;
|
||||
retry?: () => void;
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { errorCode, useBrokerageAccounts } from "@/entities/brokerage-account";
|
||||
import {
|
||||
brokerageAccountCards,
|
||||
errorCode,
|
||||
useBrokerageAccounts,
|
||||
} from "@/entities/brokerage-account";
|
||||
|
||||
function useAccountsPageViewModel() {
|
||||
const accounts = useBrokerageAccounts();
|
||||
@@ -20,7 +24,7 @@ function useAccountsPageViewModel() {
|
||||
};
|
||||
return {
|
||||
state: "loaded" as const,
|
||||
accounts: accounts.data,
|
||||
accounts: brokerageAccountCards(accounts.data),
|
||||
refreshing: accounts.isFetching,
|
||||
refreshError: accounts.isError,
|
||||
retry: () => accounts.refetch(),
|
||||
|
||||
Reference in New Issue
Block a user