Spaces:
Runtime error
Runtime error
| 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, | |
| }); | |
| } | |