refactor: enforce frontend view model boundaries
This commit is contained in:
@@ -10,7 +10,14 @@ import { TbankConnectionSectionLoaded } from "./TbankConnectionSectionLoaded";
|
||||
const TbankConnectionSection: FC = () => {
|
||||
const viewModel = useTbankConnectionViewModel();
|
||||
if (viewModel.state === "loading") return <TbankConnectionLoading />;
|
||||
return viewModel.state === "error" ? <TbankConnectionError retry={viewModel.retry} /> : <TbankConnectionSectionLoaded {...viewModel} />;
|
||||
|
||||
return viewModel.state === "error"
|
||||
? (
|
||||
<TbankConnectionError retry={viewModel.retry} />
|
||||
)
|
||||
: (
|
||||
<TbankConnectionSectionLoaded {...viewModel} />
|
||||
);
|
||||
};
|
||||
|
||||
export { TbankConnectionSection };
|
||||
|
||||
Reference in New Issue
Block a user