chore: scaffold turbo monorepo with hono api and react admin web

This commit is contained in:
Jose Selesan
2026-10-15 15:24:34 -03:00
commit 2b1d2152c4
89 changed files with 4996 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { queryOptions, useQuery } from '@tanstack/react-query'
import { apiFetch } from '@/lib/api-client'
export type HealthStatus = {
status: 'ok'
uptimeSeconds: number
timestamp: string
}
/**
* Query options are exported so route loaders can prefetch the same data:
*
* ```ts
* loader: ({ context }) => context.queryClient.ensureQueryData(healthQueryOptions())
* ```
*/
export const healthQueryOptions = () =>
queryOptions({
queryKey: ['health'],
queryFn: () => apiFetch<HealthStatus>('/health'),
})
export function useHealth() {
return useQuery(healthQueryOptions())
}