18 lines
804 B
TypeScript
18 lines
804 B
TypeScript
import type { FC } from "react";
|
|
import { useAccountEventsPageViewModel } from "./AccountEventsPage.vm";
|
|
import { AccountEventsPageError } from "./components/AccountEventsPageError.view";
|
|
import { AccountEventsPageLoaded } from "./components/AccountEventsPageLoaded.view";
|
|
import { AccountEventsPageLoading } from "./components/AccountEventsPageLoading.view";
|
|
|
|
type AccountEventsPageProps = { accountId?: string };
|
|
|
|
const AccountEventsPage: FC<AccountEventsPageProps> = (props) => {
|
|
const viewModel = useAccountEventsPageViewModel(props.accountId);
|
|
if (viewModel.state === "loading") return <AccountEventsPageLoading />;
|
|
if (viewModel.state === "error")
|
|
return <AccountEventsPageError retry={viewModel.retry} />;
|
|
return <AccountEventsPageLoaded {...viewModel} />;
|
|
};
|
|
|
|
export { AccountEventsPage };
|