diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2025-12-01 00:45:09 +0000 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2025-12-01 00:45:09 +0000 |
| commit | cbc17db44c18a19702938b3fe70ea3de81d326ea (patch) | |
| tree | c44ef96fc9e66ecb013e99b5d8e2dc8ce333ffc9 /source/96/src/app/not-found.js | |
| parent | 3ea515a495e54d63f4d16c1448eb09eba527e976 (diff) | |
| download | zue.dev-cbc17db44c18a19702938b3fe70ea3de81d326ea.tar zue.dev-cbc17db44c18a19702938b3fe70ea3de81d326ea.tar.gz zue.dev-cbc17db44c18a19702938b3fe70ea3de81d326ea.tar.bz2 zue.dev-cbc17db44c18a19702938b3fe70ea3de81d326ea.tar.xz zue.dev-cbc17db44c18a19702938b3fe70ea3de81d326ea.zip | |
make it work
Diffstat (limited to 'source/96/src/app/not-found.js')
| -rw-r--r-- | source/96/src/app/not-found.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/96/src/app/not-found.js b/source/96/src/app/not-found.js new file mode 100644 index 0000000..7298535 --- /dev/null +++ b/source/96/src/app/not-found.js @@ -0,0 +1,31 @@ +"use client"; + +import { useEffect, useState } from "react"; +import { useRouter } from "next/navigation"; + +export default () => { + const router = useRouter(); + + const [seconds, setSeconds] = useState(5); + + useEffect(() => { + const interval = setInterval(() => { + setSeconds((prev) => prev - 1); + }, 1000); + + if (seconds === 0) { + router.push("/"); + } + + return () => clearInterval(interval); + }, [seconds]); + + return ( + <div className="min-h-screen flex flex-col justify-center items-center space-y-4"> + <h2 className="text-3xl font-bold">404 - Page Not Found</h2> + <p> + Redirecting to <a href="/">Home</a> in {seconds} seconds... + </p> + </div> + ); +}; |
