Reuse account sections and group securities with per-account holdings. Use Mantine Select to preserve filters and reset pagination on scope changes. Document component reuse guardrails and cover routes, grouping and scope switching.
24 lines
860 B
TypeScript
24 lines
860 B
TypeScript
import type { FC } from "react";
|
|
import { useAccountOperationsPageVm } from "./AccountOperationsPage.vm";
|
|
import { AccountOperationsPageError } from "./components/AccountOperationsPageError.view";
|
|
import { AccountOperationsPageLoaded } from "./components/AccountOperationsPageLoaded.view";
|
|
import { AccountOperationsPageLoading } from "./components/AccountOperationsPageLoading.view";
|
|
|
|
type AccountOperationsPageProps = { accountId?: string };
|
|
|
|
const AccountOperationsPage: FC<AccountOperationsPageProps> = (props) => {
|
|
const viewModel = useAccountOperationsPageVm(props.accountId);
|
|
|
|
if (viewModel.state === "loading") {
|
|
return <AccountOperationsPageLoading />;
|
|
}
|
|
|
|
if (viewModel.state === "error") {
|
|
return <AccountOperationsPageError {...viewModel} />;
|
|
}
|
|
|
|
return <AccountOperationsPageLoaded {...viewModel} />;
|
|
};
|
|
|
|
export { AccountOperationsPage };
|