* feat(docs): add interactive examples and API references for Button, Card, and LoadingFallback components - Updated dependencies - Set `retries` to a fixed value of 3 for consistent test retries across environments. - Increased `timeout` from 60 seconds to 120 seconds to allow more time for tests to complete. - Reduced `expect` timeout from 10 seconds to 5 seconds for quicker feedback on assertions.
41 lines
989 B
TypeScript
41 lines
989 B
TypeScript
'use client';
|
|
|
|
import { useState } from 'react';
|
|
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
|
|
import { I18nProvider } from '@kit/i18n/provider';
|
|
import { Toaster } from '@kit/ui/sonner';
|
|
|
|
import { i18nResolver } from '../lib/i18n/i18n.resolver';
|
|
import { getI18nSettings } from '../lib/i18n/i18n.settings';
|
|
|
|
export function RootProviders(props: React.PropsWithChildren) {
|
|
return (
|
|
<I18nProvider settings={getI18nSettings('en')} resolver={i18nResolver}>
|
|
<ReactQueryProvider>{props.children}</ReactQueryProvider>
|
|
</I18nProvider>
|
|
);
|
|
}
|
|
|
|
function ReactQueryProvider(props: React.PropsWithChildren) {
|
|
const [queryClient] = useState(
|
|
() =>
|
|
new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 60 * 1000,
|
|
},
|
|
},
|
|
}),
|
|
);
|
|
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
{props.children}
|
|
|
|
<Toaster position="top-center" />
|
|
</QueryClientProvider>
|
|
);
|
|
}
|