Skip to content
15 changes: 7 additions & 8 deletions src/components/exec-bench-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export function ExecBenchTable({
data: ExecLeaderboardResponse | null;
}) {
const [win, setWin] = useState<Window>("24h");
const stale = useMemo(
() =>
data?.updatedAt
? Date.now() - new Date(data.updatedAt).getTime() > 3 * 60 * 60 * 1000
: false,
[data?.updatedAt]
);

if (!data) {
return (
Expand All @@ -42,14 +49,6 @@ export function ExecBenchTable({
(b.windows[win]?.txCount ?? 0) - (a.windows[win]?.txCount ?? 0),
);

const stale = useMemo(
() =>
data.updatedAt
? Date.now() - new Date(data.updatedAt).getTime() > 3 * 60 * 60 * 1000
: false,
[data.updatedAt]
);

return (
<div className="card rounded-xl overflow-hidden">
<div className="px-4 sm:px-6 pt-4 pb-0 flex items-end justify-between gap-4 flex-wrap border-b border-rule">
Expand Down
Loading