refactor: clarify frontend model ownership
This commit is contained in:
@@ -6,10 +6,8 @@ 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<AccountPageProps> = (props) => {
|
||||
const viewModel = useAccountPageViewModel(props.accountId);
|
||||
const AccountPage: FC = () => {
|
||||
const viewModel = useAccountPageViewModel();
|
||||
if (viewModel.state === "loading") return <AccountPageLoading />;
|
||||
if (viewModel.state === "error") return <AccountPageError {...viewModel} />;
|
||||
if (viewModel.state === "empty")
|
||||
|
||||
Reference in New Issue
Block a user