refactor: normalize view models and share breadcrumbs and titles (WealthLedger/frontend#143)
Frontend verify / commits (pull_request) Successful in 32s
Frontend verify / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Successful in 6m51s

This commit is contained in:
2026-11-04 18:01:20 +03:00
parent e2d143df46
commit ecc1bd74ef
30 changed files with 194 additions and 202 deletions
@@ -4,16 +4,16 @@ import {
TbankConnectionError,
TbankConnectionLoading,
} from "./TbankConnectionSection.view";
import { useTbankConnectionViewModel } from "./TbankConnectionSection.vm";
import { useTbankConnectionSectionVm } from "./TbankConnectionSection.vm";
import { TbankConnectionSectionLoaded } from "./TbankConnectionSectionLoaded";
const TbankConnectionSection: FC = () => {
const viewModel = useTbankConnectionViewModel();
if (viewModel.state === "loading") return <TbankConnectionLoading />;
const vm = useTbankConnectionSectionVm();
if (vm.state === "loading") return <TbankConnectionLoading />;
return viewModel.state === "error"
? <TbankConnectionError retry={viewModel.retry} />
: <TbankConnectionSectionLoaded {...viewModel} />;
return vm.state === "error"
? <TbankConnectionError retry={vm.retry} />
: <TbankConnectionSectionLoaded {...vm} />;
};
export { TbankConnectionSection };
@@ -2,7 +2,7 @@ import { useAuthenticatedQuery } from "@/shared/api";
import { tbankConnectionQueryOptions } from "../../model/connection-boundary";
function useTbankConnectionViewModel() {
function useTbankConnectionSectionVm() {
const status = useAuthenticatedQuery({
...tbankConnectionQueryOptions(),
});
@@ -22,4 +22,4 @@ function useTbankConnectionViewModel() {
};
}
export { useTbankConnectionViewModel };
export { useTbankConnectionSectionVm };