mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-16 05:10:42 -07:00
15 lines
438 B
TypeScript
15 lines
438 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
import { apiClient } from '@/lib/api/client';
|
|
import { useServerStore } from '@/stores/serverStore';
|
|
|
|
export function useServerHealth() {
|
|
const serverUrl = useServerStore((state) => state.serverUrl);
|
|
|
|
return useQuery({
|
|
queryKey: ['server', 'health', serverUrl],
|
|
queryFn: () => apiClient.getHealth(),
|
|
refetchInterval: 30000, // Check every 30 seconds
|
|
retry: 1,
|
|
});
|
|
}
|