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