summaryrefslogtreecommitdiff
path: root/src/app/not-found.tsx
diff options
context:
space:
mode:
authorBertrand Yuan <bert.yuan@outlook.com>2025-12-15 23:48:10 +0800
committerBertrand Yuan <bert.yuan@outlook.com>2025-12-15 23:48:10 +0800
commit5b7ccf0b671e2999b62befc729a3e517a0433728 (patch)
tree8bf476dc7c75914c221042546840dc76267366df /src/app/not-found.tsx
initial commit -- the front-end prototype
The initial code is base on Anirudh's work. More to see at: https://github.com/techwithanirudh/shadcn-blog Therefore, the code in this commit is under MIT license.
Diffstat (limited to 'src/app/not-found.tsx')
-rw-r--r--src/app/not-found.tsx49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx
new file mode 100644
index 0000000..ecec57a
--- /dev/null
+++ b/src/app/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,
+ });
+}