import Link from "next/link"; import { signIn, useSession } from "next-auth/react"; import { useEffect, useState } from "react"; import { useRouter } from "next/router"; import { parseCookies, setCookie } from "nookies"; function Footer() { const { data: session, status } = useSession(); const [year, setYear] = useState(new Date().getFullYear()); const [season, setSeason] = useState(getCurrentSeason()); const [lang, setLang] = useState("en"); const [checked, setChecked] = useState(false); const [cookie, setCookies] = useState(null); const router = useRouter(); useEffect(() => { let lang = null; if (!cookie) { const cookie = parseCookies(); lang = cookie.lang || null; setCookies(cookie); } if (lang === "en" || lang === null) { setLang("en"); setChecked(false); } else if (lang === "id") { setLang("id"); setChecked(true); } }, []); function switchLang() { setChecked(!checked); if (checked) { console.log("switching to en"); setCookie(null, "lang", "en", { maxAge: 365 * 24 * 60 * 60, path: "/", }); router.push("/en"); } else { console.log("switching to id"); setCookie(null, "lang", "id", { maxAge: 365 * 24 * 60 * 60, path: "/", }); router.push("/id"); } } return (
{/*

moopa

*/}

moopa

© {new Date().getFullYear()} moopa.live | Website Made by Factiven

This site does not store any files on our server, we only linked to the media which is hosted on 3rd party services.

{/*
gambar
*/}
  • This Season
  • Popular Anime
  • Popular Manga
  • {status === "loading" ? (

    Loading...

    ) : session ? (
  • My List
  • ) : (
  • )}
  • Movies
  • TV Shows
  • DMCA
  • Github
); } export default Footer; function getCurrentSeason() { const now = new Date(); const month = now.getMonth() + 1; // getMonth() returns 0-based index switch (month) { case 12: case 1: case 2: return "WINTER"; case 3: case 4: case 5: return "SPRING"; case 6: case 7: case 8: return "SUMMER"; case 9: case 10: case 11: return "FALL"; default: return "UNKNOWN SEASON"; } }