import type { FC } from "react"; import { useAccountPageViewModel } from "./AccountPage.vm"; import { AccountPageEmpty } from "./components/AccountPageEmpty.view"; import { AccountPageError } from "./components/AccountPageError.view"; import { AccountPageLoaded } from "./components/AccountPageLoaded.view"; import { AccountPageLoading } from "./components/AccountPageLoading/AccountPageLoading.view"; type AccountPageProps = { accountId?: string }; const AccountPage: FC = (props) => { const viewModel = useAccountPageViewModel(props.accountId); if (viewModel.state === "loading") return ; if (viewModel.state === "error") return ; if (viewModel.state === "empty") return ( ); return ( ); }; export { AccountPage };