refactor(account-operations): split page state views into components
Extract loading/error/loaded state views from the single AccountOperationsPage.view.tsx into dedicated files under components/. Document the "one state per view file" rule as a mandatory review convention in CONVENTIONS.md and UI-PATTERN.md. Co-Authored-By: opencode <opencode@anthropic.com>
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
import type { FC } from "react";
|
||||
import { LedgerEntryRow } from "@/entities/broker-operation";
|
||||
import {
|
||||
AccountOperationsPageError,
|
||||
AccountOperationsPageLoaded,
|
||||
AccountOperationsPageLoading,
|
||||
} from "./AccountOperationsPage.view";
|
||||
import { useAccountOperationsPageVm } from "./AccountOperationsPage.vm";
|
||||
import { AccountOperationsPageError } from "./components/AccountOperationsPageError.view";
|
||||
import { AccountOperationsPageLoaded } from "./components/AccountOperationsPageLoaded.view";
|
||||
import { AccountOperationsPageLoading } from "./components/AccountOperationsPageLoading.view";
|
||||
|
||||
const AccountOperationsPage: FC = () => {
|
||||
const viewModel = useAccountOperationsPageVm();
|
||||
|
||||
if (viewModel.state === "loading") return <AccountOperationsPageLoading />;
|
||||
if (viewModel.state === "error")
|
||||
if (viewModel.state === "loading") {
|
||||
return <AccountOperationsPageLoading />;
|
||||
}
|
||||
|
||||
if (viewModel.state === "error") {
|
||||
return <AccountOperationsPageError {...viewModel} />;
|
||||
}
|
||||
|
||||
return <AccountOperationsPageLoaded {...viewModel} />;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user