Skip to content

Commit

Permalink
refactor: not found page
Browse files Browse the repository at this point in the history
  • Loading branch information
rharkor committed Sep 18, 2023
1 parent 2acb8f9 commit ba32155
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
25 changes: 3 additions & 22 deletions src/app/[lang]/[...not-found]/page.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<main className="container flex min-h-screen flex-1 flex-col items-center justify-center gap-3">
<h1 className="text-4xl font-bold">{dictionary.notFound}</h1>
<Link href="/" className={buttonVariants({ variant: "ghost" })}>
{dictionary.home}
</Link>
</main>
)
export default function Page404MatchAll() {
notFound()
}
14 changes: 14 additions & 0 deletions src/app/[lang]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<main className="container flex min-h-screen flex-1 flex-col items-center justify-center gap-3">
<h1 className="text-4xl font-bold">Not found</h1>
<Link href="/" className={buttonVariants({ variant: "ghost" })}>
Home
</Link>
</main>
)
}

0 comments on commit ba32155

Please sign in to comment.