| 1 | "use client"; |
| 2 | |
| 3 | import { useState } from "react"; |
| 4 | import { QueryClientProvider } from "@tanstack/react-query"; |
| 5 | import { Toaster } from "sonner"; |
| 6 | import { makeQueryClient } from "@/lib/query"; |
| 7 | import { TooltipProvider } from "@/components/ui/tooltip"; |
| 8 | |
| 9 | export function Providers({ children }: { children: React.ReactNode }) { |
| 10 | const [queryClient] = useState(makeQueryClient); |
| 11 | |
| 12 | return ( |
| 13 | <QueryClientProvider client={queryClient}> |
| 14 | <TooltipProvider delayDuration={200} skipDelayDuration={400}> |
| 15 | {children} |
| 16 | <Toaster |
| 17 | position="bottom-right" |
| 18 | theme="dark" |
| 19 | richColors |
| 20 | closeButton |
| 21 | toastOptions={{ |
| 22 | classNames: { |
| 23 | toast: |
| 24 | "!bg-[var(--color-bg-overlay)] !border !border-[var(--color-border-default)] !text-[var(--color-fg-primary)] !rounded-[var(--radius-md)]", |
| 25 | }, |
| 26 | }} |
| 27 | /> |
| 28 | </TooltipProvider> |
| 29 | </QueryClientProvider> |
| 30 | ); |
| 31 | } |