Files
frontend/src/entities/bank-card/ui/BankFeedback.tsx
T
ksv741 3eafad2657
Frontend security / security (push) Successful in 9s
Frontend verify / verify (push) Failing after 37m50s
Frontend security / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Failing after 42m10s
Conventional commits / commits (pull_request) Successful in 29s
chore: finish frontend ESLint migration #18
Enable every plugin recommended preset and replace Biome with ESLint formatting.

Preserve API contracts and JSX whitespace; verify source, tests, builds and tooling.
2026-09-28 07:31:28 +03:00

40 lines
926 B
TypeScript

import type { FC } from "react";
import { Alert, Button, Group, Text } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { apiErrorCode } from "@/shared/api";
type BankFeedbackProps = {
cached?: boolean;
error: unknown;
loadingError?: boolean;
retry?: () => void;
};
const BankFeedback: FC<BankFeedbackProps> = (props) => {
const { t } = useTranslation();
const code = apiErrorCode(props.error);
return (
<Alert color="orange" role="alert">
<Group>
<Text>
{props.cached
? t("bank.refreshError")
: t(`bank.errors.${code}` as "bank.errors.BANK_INVALID_INPUT", {
defaultValue: t(
props.loadingError ? "bank.error" : "bank.requestError",
),
})}
</Text>
{props.retry && (
<Button onClick={props.retry} variant="default">
{t("bank.retry")}
</Button>
)}
</Group>
</Alert>
);
};
export { BankFeedback };