2024-04-03 13:00:54 +00:00
|
|
|
import { Box, Typography } from "@mui/material";
|
|
|
|
import { FallbackProps } from "react-error-boundary";
|
|
|
|
|
|
|
|
type Props = Partial<FallbackProps>;
|
|
|
|
|
|
|
|
export const ApologyPage = ({ error }: Props) => {
|
|
|
|
let message = "Что-то пошло не так";
|
2024-04-08 11:00:02 +00:00
|
|
|
|
2024-04-11 08:01:37 +00:00
|
|
|
if (error.response?.data === "quiz is inactive") message = "Квиз не активирован";
|
2024-04-03 13:00:54 +00:00
|
|
|
if (error.message === "No questions found") message = "Нет созданных вопросов";
|
|
|
|
if (error.message === "Quiz already completed") message = "Вы уже прошли этот опрос";
|
2024-04-24 15:56:11 +00:00
|
|
|
if (error.message === "No quiz id") message = "Отсутствует id квиза";
|
2024-04-14 21:15:39 +00:00
|
|
|
if (error.response?.data === "Invalid request data") message = "Такого квиза не существует";
|
2024-04-03 13:00:54 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Box
|
|
|
|
sx={{
|
|
|
|
display: "flex",
|
|
|
|
alignItems: "center",
|
|
|
|
justifyContent: "center",
|
|
|
|
height: "100%",
|
2024-05-04 16:47:17 +00:00
|
|
|
backgroundColor: "#F2F3F7",
|
2024-04-03 13:00:54 +00:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Typography
|
|
|
|
sx={{
|
|
|
|
textAlign: "center",
|
|
|
|
color: "text.primary",
|
|
|
|
}}
|
|
|
|
>{message}</Typography>
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
};
|