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:
2026-08-27 10:53:23 +03:00
co-authored by opencode
parent 8f9caa946e
commit 695cda0456
6 changed files with 73 additions and 53 deletions
@@ -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} />;
};