From bad2b107ba36a3d3ec2c2df913bb00df590d6db9 Mon Sep 17 00:00:00 2001 From: nxtkofi Date: Tue, 21 Apr 2026 23:26:52 +0200 Subject: [PATCH] feat(routing): add localized and root not-found handling Add localized 404 page, catch-all route, and root not-found fallback Co-authored-by: Sisyphus --- src/app/[locale]/[...rest]/page.tsx | 5 +++++ src/app/[locale]/not-found.tsx | 34 +++++++++++++++++++++++++++++ src/app/not-found.tsx | 29 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 src/app/[locale]/[...rest]/page.tsx create mode 100644 src/app/[locale]/not-found.tsx create mode 100644 src/app/not-found.tsx diff --git a/src/app/[locale]/[...rest]/page.tsx b/src/app/[locale]/[...rest]/page.tsx new file mode 100644 index 0000000..2dc2960 --- /dev/null +++ b/src/app/[locale]/[...rest]/page.tsx @@ -0,0 +1,5 @@ +import { notFound } from "next/navigation"; + +export default function CatchAllPage() { + notFound(); +} diff --git a/src/app/[locale]/not-found.tsx b/src/app/[locale]/not-found.tsx new file mode 100644 index 0000000..c2f33da --- /dev/null +++ b/src/app/[locale]/not-found.tsx @@ -0,0 +1,34 @@ +import { getTranslations } from "next-intl/server"; +import Link from "next/link"; +import { routes } from "@/lib/routes"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; + +export default async function NotFound() { + const t = await getTranslations("Fallback.NotFound"); + + return ( +
+ + + {t("Title")} + {t("Description")} + + + + + +
+ ); +} diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx new file mode 100644 index 0000000..e218a9b --- /dev/null +++ b/src/app/not-found.tsx @@ -0,0 +1,29 @@ +"use client"; + +import Link from "next/link"; + +export default function NotFound() { + return ( + + +
+
+

404

+

+ Page not found +

+ + Go back home + +
+
+ + + ); +}