diff --git a/src/components/ChatInterface.tsx b/src/components/ChatInterface.tsx index 639797c..e91e3e1 100644 --- a/src/components/ChatInterface.tsx +++ b/src/components/ChatInterface.tsx @@ -146,6 +146,9 @@ export default function ChatInterface() {

{activeThread?.title}

+
+ +
diff --git a/src/components/Clock.tsx b/src/components/Clock.tsx new file mode 100644 index 0000000..3bbd101 --- /dev/null +++ b/src/components/Clock.tsx @@ -0,0 +1,104 @@ +import { Clock as ClockIcon } from "lucide-react"; + +function Clock() { + let now: any = new Date(); + let time: any = + now.getHours().toString().padStart(2, "0") + + ":" + + now.getMinutes().toString().padStart(2, "0") + + ":" + + now.getSeconds().toString().padStart(2, "0"); + + let polishMonths: any = ["stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", + "lipca", "sierpnia", "września", "października", "listopada", "grudnia"]; + let polishDays: any = ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"]; + + let dateStr: any = polishDays[now.getDay()] + ", " + + now.getDate() + " " + + polishMonths[now.getMonth()] + " " + + now.getFullYear(); + + let timeElement: any; + let dateElement: any; + + setTimeout(() => { + if (timeElement) { + let newNow: any = new Date(); + timeElement.innerHTML = + newNow.getHours().toString().padStart(2, "0") + + ":" + + newNow.getMinutes().toString().padStart(2, "0") + + ":" + + newNow.getSeconds().toString().padStart(2, "0"); + } + if (dateElement) { + let newNow: any = new Date(); + dateElement.innerHTML = polishDays[newNow.getDay()] + ", " + + newNow.getDate() + " " + + polishMonths[newNow.getMonth()] + " " + + newNow.getFullYear(); + } + }, 1000); + + setInterval(() => { + if (timeElement) { + let newNow: any = new Date(); + timeElement.innerHTML = + newNow.getHours().toString().padStart(2, "0") + + ":" + + newNow.getMinutes().toString().padStart(2, "0") + + ":" + + newNow.getSeconds().toString().padStart(2, "0"); + } + if (dateElement) { + let newNow: any = new Date(); + dateElement.innerHTML = polishDays[newNow.getDay()] + ", " + + newNow.getDate() + " " + + polishMonths[newNow.getMonth()] + " " + + newNow.getFullYear(); + } + }, 1000); + + return ( +
+
+ + { + timeElement = el; + }}> + {time} + +
+
{ + dateElement = el; + }} + style={{ + fontSize: "12px", + color: "#666", + fontWeight: "normal", + }}> + {dateStr} +
+
+ ); +} + +export default Clock;