"use client"; import { useState, useEffect } from "react"; import { useTheme } from "next-themes"; import DateWeatherLinks from "./components/DateWeatherLinks"; import WhoisChart from "./components/WhoisChart"; import { Data, DataContext, fetchWeather, fetchWhois, } from "@/lib/data-context"; export default function Home() { // god i hate next. const [mounted, setMounted] = useState(false); const { theme, setTheme } = useTheme(); const [data, setData] = useState({}); useEffect(() => { setMounted(true); }, []); useEffect(() => { const update = () => fetchWeather().then((weather) => setData((data) => data && { ...data, weather }) ); update(); const interval = setInterval(update, 5 * 60_000); // 5 mins return () => clearInterval(interval); }, []); useEffect(() => { const update = () => fetchWhois().then((whois) => setData((data) => data && { ...data, whois }) ); update(); const interval = setInterval(update, 5 * 1_000); // 5 seconds return () => clearInterval(interval); }, []); if (!mounted) return null; return (

🐧 Penguin New Tab

); }