Files
awoooi/apps/web/src/hooks/use-health.ts
OG T 196d269b92 feat: add all application source code
- apps/api: FastAPI backend with Dockerfile
- apps/web: Next.js frontend with Dockerfile
- apps/sensor: Signal collection agent
- packages: shared packages

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 18:57:44 +08:00

21 lines
352 B
TypeScript

/**
* Health Check Hook
*/
'use client'
import { useQuery } from '@tanstack/react-query'
import { apiClient } from '@/lib/api-client'
/**
* 系統健康狀態
*/
export function useHealth() {
return useQuery({
queryKey: ['health'],
queryFn: () => apiClient.getHealth(),
refetchInterval: 30000, // 30 秒輪詢
retry: 3,
})
}