Files
myeasycms-v2/apps/web/components/root-providers.tsx
giancarlo 0002ac6255 Refactor billing imports, reorganize package scripts and improve action structure
Deleted unnecessary schema files and reorganized their imports into more logical order. Modified the package script structure to align more accurately with standard conventions. Also refactored the team-billing.service file to improve action structure, making it easier to understand and edit. Furthermore, upgraded various dependencies, reflecting their new versions in the lockfile.
2024-04-07 12:47:29 +08:00

48 lines
1.5 KiB
TypeScript

'use client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
import { ThemeProvider } from 'next-themes';
import { CaptchaProvider, CaptchaTokenSetter } from '@kit/auth/captcha/client';
import { I18nProvider } from '@kit/i18n/provider';
import { AuthChangeListener } from '@kit/supabase/components/auth-change-listener';
import appConfig from '~/config/app.config';
import authConfig from '~/config/auth.config';
import pathsConfig from '~/config/paths.config';
import { i18nResolver } from '~/lib/i18n/i18n.resolver';
const captchaSiteKey = authConfig.captchaTokenSiteKey;
const queryClient = new QueryClient();
export function RootProviders({
lang,
children,
}: React.PropsWithChildren<{
lang: string;
}>) {
return (
<QueryClientProvider client={queryClient}>
<ReactQueryStreamedHydration>
<CaptchaProvider>
<CaptchaTokenSetter siteKey={captchaSiteKey} />
<AuthChangeListener appHomePath={pathsConfig.app.home}>
<I18nProvider lang={lang} resolver={i18nResolver}>
<ThemeProvider
attribute="class"
enableSystem
disableTransitionOnChange
defaultTheme={appConfig.theme}
>
{children}
</ThemeProvider>
</I18nProvider>
</AuthChangeListener>
</CaptchaProvider>
</ReactQueryStreamedHydration>
</QueryClientProvider>
);
}