summaryrefslogtreecommitdiff
path: root/src/app/(main)/not-found.tsx
diff options
context:
space:
mode:
authorBertrand Yuan <bert.yuan@outlook.com>2025-12-16 00:12:49 +0800
committerBertrand Yuan <bert.yuan@outlook.com>2025-12-16 00:12:49 +0800
commit02ae938c238c9d18448d17a8ec92c0edd8c17463 (patch)
treedcd6a30505adb52522b20af2c0ac27f713403f10 /src/app/(main)/not-found.tsx
parent48b07bc308a35734a6a7a305c8fdccbfa47de7d8 (diff)
feat(back-end): introduce payload
Payload is the next.js Headless CMS and App Framework, I would like to pick it up and modify it as it is MIT licensed. Many features in Payload is not applicable for our project. So, I modify it so that it is light and clear.
Diffstat (limited to 'src/app/(main)/not-found.tsx')
-rw-r--r--src/app/(main)/not-found.tsx49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/app/(main)/not-found.tsx b/src/app/(main)/not-found.tsx
new file mode 100644
index 0000000..ecec57a
--- /dev/null
+++ b/src/app/(main)/not-found.tsx
@@ -0,0 +1,49 @@
+import { Header } from '@/components/sections/header';
+import { createMetadata } from '@/lib/metadata';
+import { HomeLayout } from 'fumadocs-ui/layouts/home';
+import { getLinks } from 'fumadocs-ui/layouts/shared';
+import type { Metadata } from 'next';
+import { baseOptions, linkItems } from './layout.config';
+
+export default function NotFound() {
+ return (
+ <HomeLayout
+ {...baseOptions}
+ links={linkItems}
+ nav={{
+ component: (
+ <Header
+ finalLinks={getLinks(linkItems, baseOptions.githubUrl)}
+ {...baseOptions}
+ />
+ ),
+ }}
+ className='pt-0'
+ >
+ <main className='flex flex-1 px-4 sm:px-8 md:px-12 lg:px-16 2xl:px-24'>
+ <div className='container flex min-h-full flex-1 items-center justify-center border-border/70 border-x border-b border-dashed dark:border-border'>
+ <div className='flex flex-auto flex-col items-center justify-center px-4 text-center sm:flex-row'>
+ <h1 className='border-border font-extrabold text-2xl text-foreground tracking-tight sm:mr-6 sm:border-r sm:pr-6 sm:text-3xl'>
+ 404
+ </h1>
+ <h2 className='mt-2 text-muted-foreground sm:mt-0'>
+ This page could not be found.
+ </h2>
+ </div>
+ </div>
+ </main>
+ </HomeLayout>
+ );
+}
+
+export async function generateMetadata(props: {
+ params: Promise<{ slug?: string[] }>;
+}): Promise<Metadata> {
+ const params = await props.params;
+ const description = 'The page you are looking for could not be found.';
+
+ return createMetadata({
+ title: 'Not Found',
+ description,
+ });
+}