44 lines
1006 B
TypeScript
44 lines
1006 B
TypeScript
import type { FC } from "react";
|
|
|
|
import { Button, Group } from "@mantine/core";
|
|
import { StateView } from "@wealthledger/ui";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import { ReadRetryButton } from "@/shared/ui";
|
|
|
|
import type { AccountOperationsPageViewModel } from "../AccountOperationsPage.vm";
|
|
|
|
type AccountOperationsPageErrorProps = Extract<
|
|
AccountOperationsPageViewModel,
|
|
{ state: "error" }
|
|
>;
|
|
|
|
const AccountOperationsPageError: FC<AccountOperationsPageErrorProps> = (
|
|
props,
|
|
) => {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<StateView
|
|
action={(
|
|
<Group gap="sm" justify="center">
|
|
{props.readRetry.exhausted && (
|
|
<ReadRetryButton
|
|
onRetry={props.readRetry.onRetry}
|
|
retrying={props.readRetry.retrying}
|
|
/>
|
|
)}
|
|
|
|
<Button onClick={props.onReset} variant="default">
|
|
{t("ledger.reset")}
|
|
</Button>
|
|
</Group>
|
|
)}
|
|
text={t("ledger.errorText")}
|
|
title={t("ledger.errorTitle")}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export { AccountOperationsPageError };
|