my-voicebox / app /src /lib /hooks /useServer.ts
matahari999
보이스박스 인스톨 폴더 모델 최초 업로드
442a1fe
Raw
History Blame Contribute Delete
438 Bytes
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,
});
}