"use client"; import { useState, useEffect, useContext } from "react"; import QuickLinks from "./QuickLinks"; import { DataContext } from "@/lib/data-context"; export default function DateWeatherLinksWelcome() { const [date, setDate] = useState(new Date()); const data = useContext(DataContext); useEffect(() => { const timer = setInterval(() => setDate(new Date()), 1000); return () => clearInterval(timer); }, []); return (

{date.toLocaleDateString(undefined, { weekday: "long", year: "numeric", month: "long", day: "numeric", })}

{date.toLocaleTimeString()}

{data?.weather ? Math.round(data.weather.temperature * (9 / 5) + 32) + "°F" : "--"}

{data?.weather ? data.weather.description : "--"}


); }