Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | import { Typography } from "@mui/material"; import Actions from "components/Actions"; import Button from "components/Button"; import ReportButton from "components/Navigation/ReportButton"; import PageTitle from "components/PageTitle"; import { GLOBAL } from "i18n/namespaces"; import Link from "next/link"; import { useRouter } from "next/router"; import { useTranslation } from "next-i18next"; import { baseRoute } from "routes"; import { theme } from "theme"; import makeStyles from "utils/makeStyles"; const useStyles = makeStyles((theme) => ({ report: { marginTop: theme.spacing(2), }, })); export default function ErrorFallback({ isFatal }: { isFatal?: boolean }) { const { t } = useTranslation(GLOBAL); const classes = useStyles(); const router = useRouter(); const handleRefresh = () => router.reload(); return ( <> <PageTitle>{t("error.fallback.title")}</PageTitle> <Typography variant="body1"> {isFatal ? t("error.fatal_message") : t("error.fallback.subtitle")} </Typography> {!isFatal && ( <div className={classes.report}> <ReportButton isResponsive={false} /> </div> )} <Actions> {!isFatal && ( <Link href={baseRoute} passHref legacyBehavior> <Button variant="outlined" component="a" sx={{ color: theme.palette.common.black, borderColor: theme.palette.grey[300], "&:hover": { borderColor: theme.palette.grey[300], backgroundColor: "#3135390A", }, }} > {t("error.fallback.home_page_link_label")} </Button> </Link> )} <Button onClick={handleRefresh}> {t("error.fallback.refresh_page_button_label")} </Button> </Actions> </> ); } |