Part of the quiet-user-feedback change; docs and specs land in their own repositories.
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import type { FC } from "react";
|
|
|
|
import { useAccountPageViewModel } from "./AccountPage.vm";
|
|
import { AccountPageEmpty } from "./components/AccountPageEmpty.view";
|
|
import { AccountPageError } from "./components/AccountPageError.view";
|
|
import { AccountPageLoaded } from "./components/AccountPageLoaded.view";
|
|
import { AccountPageLoading } from "./components/AccountPageLoading/AccountPageLoading.view";
|
|
|
|
const AccountPage: FC = () => {
|
|
const viewModel = useAccountPageViewModel();
|
|
if (viewModel.state === "loading") return <AccountPageLoading />;
|
|
if (viewModel.state === "error") return <AccountPageError {...viewModel} />;
|
|
if (viewModel.state === "empty")
|
|
return (
|
|
<AccountPageEmpty
|
|
account={viewModel.account}
|
|
accountId={viewModel.accountId}
|
|
incomeSummary={viewModel.incomeSummary}
|
|
recentEvents={viewModel.recentEvents}
|
|
recentOperations={viewModel.recentOperations}
|
|
/>
|
|
);
|
|
|
|
return (
|
|
<AccountPageLoaded
|
|
account={viewModel.account}
|
|
accountId={viewModel.accountId}
|
|
incomeSummary={viewModel.incomeSummary}
|
|
partial={viewModel.partial}
|
|
portfolio={viewModel.portfolio}
|
|
positionSections={viewModel.positionSections}
|
|
recentEvents={viewModel.recentEvents}
|
|
recentOperations={viewModel.recentOperations}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export { AccountPage };
|