import Link from "next/link"; import { useState } from "react"; import { useRouter } from "next/router"; function Footer() { const [year] = useState(new Date().getFullYear()); const [season] = useState(getCurrentSeason()); const [checked, setChecked] = useState(false); const router = useRouter(); function switchLang() { setChecked(!checked); if (checked) { router.push("/en"); } else { router.push("/id"); } } return ( ); } 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"; } }