From b97f3b42e1bad5753728315b5c7ebdacf6f81172 Mon Sep 17 00:00:00 2001
From: Elizabeth Hunt <elizabeth.hunt@simponic.xyz>
Date: Mon, 6 Jan 2025 23:48:56 -0800
Subject: initial commit

---
 app/components/DateWeatherLinks.tsx | 47 +++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 app/components/DateWeatherLinks.tsx

(limited to 'app/components/DateWeatherLinks.tsx')

diff --git a/app/components/DateWeatherLinks.tsx b/app/components/DateWeatherLinks.tsx
new file mode 100644
index 0000000..1c004fa
--- /dev/null
+++ b/app/components/DateWeatherLinks.tsx
@@ -0,0 +1,47 @@
+"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 (
+    <div className="glass rounded-lg p-6 shadow-lg">
+      <div className="flex justify-between items-center">
+        <div>
+          <h2 className="text-3xl font-bold text-gray-800 dark:text-gray-100">
+            {date.toLocaleDateString(undefined, {
+              weekday: "long",
+              year: "numeric",
+              month: "long",
+              day: "numeric",
+            })}
+          </h2>
+          <p className="text-xl text-gray-600 dark:text-gray-300">
+            {date.toLocaleTimeString()}
+          </p>
+        </div>
+        <div className="text-right">
+          <p className="text-4xl font-bold text-gray-800 dark:text-gray-100">
+            {data?.weather
+              ? Math.round(data.weather.temperature * (9 / 5) + 32) + "°F"
+              : "--"}
+          </p>
+          <p className="text-xl text-gray-600 dark:text-gray-300">
+            {data?.weather ? data.weather.description : "--"}
+          </p>
+        </div>
+      </div>
+      <br />
+      <QuickLinks />
+    </div>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

