feat(ui): custom 404 page

This commit is contained in:
Fu Diwei 2025-07-15 16:05:48 +08:00
parent 3fec80f9d5
commit 3bd2bee321
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import { Outlet } from "react-router-dom";
import { Layout } from "antd";
const ErrorLayout = ({ children }: { children?: React.ReactNode }) => {
return (
<Layout className="h-screen">
<div className="relative">{children || <Outlet />}</div>
</Layout>
);
};
export default ErrorLayout;

View File

@ -5,6 +5,7 @@ import AuthLayout from "./pages/AuthLayout";
import CertificateList from "./pages/certificates/CertificateList";
import ConsoleLayout from "./pages/ConsoleLayout";
import Dashboard from "./pages/dashboard/Dashboard";
import ErrorLayout from "./pages/ErrorLayout";
import Login from "./pages/login/Login";
import Settings from "./pages/settings/Settings";
import SettingsAccount from "./pages/settings/SettingsAccount";
@ -83,4 +84,17 @@ export const router = createHashRouter([
},
],
},
{
path: "*",
element: (
<ErrorLayout>
<div className="flex h-screen w-full flex-col items-center justify-center">
<div className="flex flex-wrap items-center justify-center gap-x-4 gap-y-2">
<h1>404</h1>
<h2>This page could not be found.</h2>
</div>
</div>
</ErrorLayout>
),
},
]);