aboutsummaryrefslogtreecommitdiff
path: root/pages/404.js
blob: 5b6162b5253230acec5418e85dbca9c789322e39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import Head from "next/head";
import Footer from "../components/footer";
import Navbar from "../components/navbar";
import Link from "next/link";
import { useEffect, useState } from "react";
import { parseCookies } from "nookies";
import Image from "next/image";

export default function Custom404() {
  const [lang, setLang] = useState("en");
  const [cookie, setCookies] = useState(null);

  useEffect(() => {
    let lang = null;
    if (!cookie) {
      const cookie = parseCookies();
      lang = cookie.lang || null;
      setCookies(cookie);
    }
    if (lang === "en" || lang === null) {
      setLang("en");
    } else if (lang === "id") {
      setLang("id");
    }
  }, []);
  return (
    <>
      <Head>
        <title>Not Found</title>
        <meta name="about" content="About this web" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="icon" href="/svg/c.svg" />
      </Head>
      <Navbar className="bg-[#0c0d10]" />
      <div className="min-h-screen w-screen flex flex-col items-center justify-center ">
        <Image
          width={500}
          height={500}
          src="/svg/404.svg"
          alt="404"
          className="w-[26vw] md:w-[15vw]"
        />
        <h1 className="text-2xl sm:text-4xl xl:text-6xl font-bold my-4">
          Oops! Page not found
        </h1>
        <p className="text-base sm:text-lg xl:text-xl text-gray-300 mb-6 text-center">
          The page you're looking for doesn't seem to exist.
        </p>
        <Link href={`/${lang}/`}>
          <div className="bg-[#fa7d56] xl:text-xl text-white font-bold py-2 px-4 rounded hover:bg-[#fb6f44]">
            Go back home
          </div>
        </Link>
      </div>
      <Footer />
    </>
  );
}