refactor: enforce frontend view model boundaries
This commit is contained in:
@@ -12,11 +12,13 @@ type AccountsPageErrorProps = { code?: string; retry?: () => void };
|
||||
const AccountsPageError: FC<AccountsPageErrorProps> = (props) => {
|
||||
const { code, retry } = props;
|
||||
const { t } = useTranslation();
|
||||
|
||||
const settingsAction = (
|
||||
<Button component={Link} to="/settings" variant="light">
|
||||
{t("accounts.openSettings")}
|
||||
</Button>
|
||||
);
|
||||
|
||||
if (isApiErrorCode(code, ApiErrorCode.TbankNotConnected))
|
||||
return (
|
||||
<StateView
|
||||
@@ -41,6 +43,7 @@ const AccountsPageError: FC<AccountsPageErrorProps> = (props) => {
|
||||
action={(
|
||||
<Stack align="flex-start">
|
||||
<Button onClick={retry}>{t("accounts.retry")}</Button>
|
||||
|
||||
{settingsAction}
|
||||
</Stack>
|
||||
)}
|
||||
@@ -49,6 +52,7 @@ const AccountsPageError: FC<AccountsPageErrorProps> = (props) => {
|
||||
title={t("accounts.unavailableTitle")}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<StateView
|
||||
action={<Button onClick={retry}>{t("accounts.retry")}</Button>}
|
||||
|
||||
Reference in New Issue
Block a user