2026-02-22 21:35:53 +01:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
|
|
|
import { Toaster } from 'sonner';
|
|
|
|
|
import { useState } from 'react';
|
2026-02-26 17:48:16 +01:00
|
|
|
import { TooltipProvider } from '@/components/ui/tooltip';
|
2026-02-26 18:01:33 +01:00
|
|
|
import { SWRegistration } from './SWRegistration';
|
2026-02-22 21:35:53 +01:00
|
|
|
|
|
|
|
|
export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
|
|
const [queryClient] = useState(
|
|
|
|
|
() =>
|
|
|
|
|
new QueryClient({
|
|
|
|
|
defaultOptions: {
|
|
|
|
|
queries: {
|
|
|
|
|
staleTime: 60 * 1000, // 1 minute
|
|
|
|
|
refetchOnWindowFocus: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
2026-02-26 22:22:32 +01:00
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
|
<TooltipProvider>
|
|
|
|
|
<SWRegistration />
|
|
|
|
|
{children}
|
|
|
|
|
</TooltipProvider>
|
2026-03-01 16:28:47 +01:00
|
|
|
<Toaster
|
|
|
|
|
theme="dark"
|
|
|
|
|
position="bottom-right"
|
|
|
|
|
toastOptions={{
|
|
|
|
|
classNames: {
|
|
|
|
|
toast:
|
|
|
|
|
'!bg-[#13131f] !border !border-white/8 !text-white/85 !rounded-xl !shadow-2xl !font-sans',
|
|
|
|
|
title: '!text-sm !font-medium !text-white/85',
|
|
|
|
|
description: '!text-xs !text-white/45',
|
|
|
|
|
icon: '!mt-px',
|
|
|
|
|
success: '!border-primary/25',
|
|
|
|
|
error: '!border-red-500/25',
|
|
|
|
|
warning: '!border-amber-400/25',
|
|
|
|
|
info: '!border-blue-400/25',
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2026-02-26 22:22:32 +01:00
|
|
|
</QueryClientProvider>
|
2026-02-22 21:35:53 +01:00
|
|
|
);
|
|
|
|
|
}
|