feat(web/trades): force-dynamic + auto-refresh every 30s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
romysaputrasihananda
2026-06-11 15:55:45 +07:00
co-authored by Claude Sonnet 4.6
parent 5bf0386cd4
commit 179b0ee055
2 changed files with 28 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
"use client";
import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
export default function TradesRefresher() {
const router = useRouter();
const [lastUpdated, setLastUpdated] = useState<Date>(new Date());
useEffect(() => {
const id = setInterval(() => {
router.refresh();
setLastUpdated(new Date());
}, 30_000);
return () => clearInterval(id);
}, [router]);
return (
<span className="text-xs text-ink-ter font-mono">
Updated {lastUpdated.toLocaleTimeString()}
</span>
);
}