From ba3215534418993bb1bf3be53e847d2ccf45fd3a Mon Sep 17 00:00:00 2001 From: rharkor Date: Mon, 18 Sep 2023 20:31:35 +0200 Subject: [PATCH] refactor: not found page --- src/app/[lang]/[...not-found]/page.tsx | 25 +++---------------------- src/app/[lang]/not-found.tsx | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 22 deletions(-) create mode 100644 src/app/[lang]/not-found.tsx diff --git a/src/app/[lang]/[...not-found]/page.tsx b/src/app/[lang]/[...not-found]/page.tsx index 63c3014a..0ac7adb2 100644 --- a/src/app/[lang]/[...not-found]/page.tsx +++ b/src/app/[lang]/[...not-found]/page.tsx @@ -1,24 +1,5 @@ -import Link from "next/link" -import React from "react" -import { buttonVariants } from "@/components/ui/button" -import { getDictionary } from "@/lib/langs" -import { Locale } from "i18n-config" +import { notFound } from "next/navigation" -export default async function Page404({ - params: { lang }, -}: { - params: { - lang: Locale - } -}) { - const dictionary = await getDictionary(lang) - - return ( -
-

{dictionary.notFound}

- - {dictionary.home} - -
- ) +export default function Page404MatchAll() { + notFound() } diff --git a/src/app/[lang]/not-found.tsx b/src/app/[lang]/not-found.tsx new file mode 100644 index 00000000..b04da83b --- /dev/null +++ b/src/app/[lang]/not-found.tsx @@ -0,0 +1,14 @@ +import Link from "next/link" +import React from "react" +import { buttonVariants } from "@/components/ui/button" + +export default async function Page404MatchAll() { + return ( +
+

Not found

+ + Home + +
+ ) +}