Add live clock to top bar
Deploy / release (push) Skipped
Deploy / deploy (push) Successful in 1m59s

This commit is contained in:
openhands committed 2026-07-23 18:32:45 +02:00
1 parent b9c09f58d3
commit eb603b50a9
4 files changed
+39

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
"use client";
import { useEffect, useState } from "react";
export function Clock() {
const [time, setTime] = useState("");
useEffect(() => {
function update() {
const now = new Date();
setTime(
now.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }),
);
}
update();
const id = setInterval(update, 30_000);
return () => clearInterval(id);
}, []);
if (!time) return null;
return (
<span
className="text-[11px] font-bold tabular-nums select-none"
style={{ color: "color-mix(in srgb, var(--color-text-muted) 60%, transparent)" }}
>
{time}
</span>
);
}