frontAnswerer/lib/components/ViewPublicationPage/ApologyPage.tsx

42 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-04-03 13:00:54 +00:00
import { Box, Typography } from "@mui/material";
import { FallbackProps } from "react-error-boundary";
2025-04-20 15:16:22 +00:00
import { useTranslation } from "react-i18next";
2024-04-03 13:00:54 +00:00
type Props = Partial<FallbackProps>;
export const ApologyPage = ({ error }: Props) => {
2025-04-20 15:16:22 +00:00
let message = error.message || error.response?.data;
2025-05-20 10:56:34 +00:00
console.log("message");
console.log(message.toLowerCase());
2025-04-20 15:16:22 +00:00
const { t } = useTranslation();
2025-05-20 10:56:34 +00:00
console.log("t");
// Проверяем, что t функция существует
if (t) {
console.log(t(message.toLowerCase()));
} else {
console.log("Translation function is not available");
}
2024-04-03 13:00:54 +00:00
2024-05-31 16:41:18 +00:00
return (
<Box
sx={{
display: "flex",
alignItems: "center",
justifyContent: "center",
height: "100%",
backgroundColor: "#F2F3F7",
}}
>
<Typography
sx={{
textAlign: "center",
color: "text.primary",
}}
>
{t ? t(message.toLowerCase()) : message}
2024-05-31 16:41:18 +00:00
</Typography>
</Box>
);
2024-04-03 13:00:54 +00:00
};