This commit is contained in:
ryan
2026-06-07 19:47:24 +08:00
parent 48d414e197
commit 360a26f109
60 changed files with 10063 additions and 637 deletions
@@ -0,0 +1,13 @@
"use client"
import { useUser } from "@/contexts/user-context"
/**
* Auth provider bridge hook
*
* Provides a stable interface for components that use the useAuth() pattern.
* Delegates to the canonical UserContext under the hood.
*/
export function useAuth() {
return useUser()
}
@@ -0,0 +1,23 @@
"use client"
import {QueryClient, QueryClientProvider} from "@tanstack/react-query"
import {useState} from "react"
export function AppQueryProvider({ children }: { children: React.ReactNode }) {
const [queryClient] = useState(
() =>
new QueryClient({
defaultOptions: {
queries: {
staleTime: 30_000,
refetchOnWindowFocus: false,
retry: 1,
},
},
}),
)
return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
)
}