-
Notifications
You must be signed in to change notification settings - Fork 0
/
providers.tsx
38 lines (35 loc) · 1.15 KB
/
providers.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use client'
import { ReactNode } from 'react'
import { SessionProvider } from 'next-auth/react'
import { CartProvider } from 'use-shopping-cart'
import { Toaster } from '../components/ui/toaster'
import { TailwindIndicator } from '../components/tailwind-indicator'
import { ThemeProvider } from '../components/theme-provider'
import { Session } from 'next-auth'
import { QueryClientProvider } from '@tanstack/react-query'
import { queryClient } from 'services/queryClient'
interface Props {
children: ReactNode
session: Session
}
export function Providers({ children, session }: Props) {
return (
<SessionProvider session={session}>
<QueryClientProvider client={queryClient}>
<CartProvider
currency="BRL"
shouldPersist
persistKey="store-88"
cartMode="checkout-session"
stripe={process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY!}
>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<Toaster />
{children}
<TailwindIndicator />
</ThemeProvider>
</CartProvider>
</QueryClientProvider>
</SessionProvider>
)
}