mirror of
https://github.com/RomySaputraSihananda/ares.git
synced 2026-08-06 15:37:48 +00:00
179b0ee055
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
563 B
TypeScript
23 lines
563 B
TypeScript
"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>
|
|
);
|
|
}
|