mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-01 01:18:34 +00:00
* refactor(ui): reorganize Lens dashboard components * refactor(ui): align Lens forms with react-hook-form Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): keep Lens submit errors out of form validity Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(ui): reduce Lens lint budget usage Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(ui): use a query key factory for Lens queries Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Yujong Lee <yujong@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
12 lines
328 B
TypeScript
12 lines
328 B
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
export function useNow(intervalMs: number) {
|
|
const [now, setNow] = useState(Date.now);
|
|
useEffect(() => {
|
|
const timer = window.setInterval(() => setNow(Date.now()), intervalMs);
|
|
return () => window.clearInterval(timer);
|
|
}, [intervalMs]);
|
|
return now;
|
|
}
|