import React, { useEffect, useState } from "react"; import type { RefineErrorPageProps } from "@refinedev/ui-types"; import { useTranslate, useGo, useResourceParams } from "@refinedev/core"; import { Box, Title, Text, Group, Tooltip, ActionIcon, Button, Space, } from "@mantine/core"; import { IconInfoCircle } from "@tabler/icons-react"; export const ErrorComponent: React.FC = () => { const [errorMessage, setErrorMessage] = useState(); const translate = useTranslate(); const go = useGo(); const { resource, action } = useResourceParams(); useEffect(() => { if (resource && action) { setErrorMessage( translate( "pages.error.info", { resource: resource?.name, }, `You may have forgotten to add the "${action}" component to "${resource?.name}" resource.`, ), ); } }, [resource, action]); return ( ({ textAlign: "center", fontWeight: 900, fontSize: 220, lineHeight: 1, color: theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[2], [theme.fn.smallerThan("sm")]: { fontSize: 120, }, })} > 404 {translate( "pages.error.404", "Sorry, the page you visited does not exist.", )} {errorMessage && ( )} ); };