refactor: enforce frontend view model boundaries
This commit is contained in:
@@ -10,7 +10,14 @@ type AccountIncomePageProps = { accountId?: string };
|
||||
const AccountIncomePage: FC<AccountIncomePageProps> = (props) => {
|
||||
const viewModel = useAccountIncomePageViewModel(props.accountId);
|
||||
if (viewModel.state === "loading") return <AccountIncomePageLoading />;
|
||||
return viewModel.state === "error" ? <AccountIncomePageError {...viewModel} /> : <AccountIncomePageLoaded {...viewModel} />;
|
||||
|
||||
return viewModel.state === "error"
|
||||
? (
|
||||
<AccountIncomePageError {...viewModel} />
|
||||
)
|
||||
: (
|
||||
<AccountIncomePageLoaded {...viewModel} />
|
||||
);
|
||||
};
|
||||
|
||||
export { AccountIncomePage };
|
||||
|
||||
Reference in New Issue
Block a user