import { Box, Typography } from "@mui/material";
import { FallbackProps } from "react-error-boundary";

type Props = Partial<FallbackProps>;

export const ApologyPage = ({ error }: Props) => {
  let message = error?.message ?? error.response?.data ?? "Something went wrong";

  return (
    <Box
      sx={{
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        height: "100%",
        backgroundColor: "#F2F3F7",
      }}
    >
      <Typography
        sx={{
          textAlign: "center",
          color: "text.primary",
        }}
      >
        {message}
      </Typography>
    </Box>
  );
};
