import { Register } from "./components";
import { Options } from "./interfaces/IOptions";
import { SwitchFormProvider } from "./context/switchForm";
import { SocialTokenProvider } from "./context/socialToken";
import { QueryClient, QueryClientProvider } from "react-query";
import { ThemeProvider, lightTheme } from '@sofaltaeu/sofaltaeu-components'

const queryClient = new QueryClient({
	defaultOptions: {
		queries: {
			refetchOnWindowFocus: false,
			staleTime: 1000 * 60 * 30, //30 segundos
		},
	},
});

interface RegisterSfeProps {
	options: Options;
}
export const RegisterSfe = ({ options }: RegisterSfeProps) => {

	return (
		<QueryClientProvider client={queryClient} contextSharing={true}>
			<ThemeProvider theme={lightTheme}>
				<SwitchFormProvider>
					<SocialTokenProvider>
						<Register options={options} />
					</SocialTokenProvider>
				</SwitchFormProvider>
			</ThemeProvider>

		</QueryClientProvider>

	);
};
