/* eslint-disable @typescript-eslint/no-explicit-any */
import type { ComponentType, PropsWithChildren } from 'react'
import React, { Suspense, useEffect } from 'react'
import { SplashScreen } from './splash-screen'
import { Router } from './router'
import { isStandalone } from '../utils/env'
import { connect } from '../boostrap'
import type { BootstrapOptions } from '../types'
import { proxyV1 } from '@vtex/raccoon-core'
const DevToolbar = React.lazy(() => import('./dev-toolbar'))
export function Challenge({ children }: PropsWithChildren) {
return (
( WrappedComponent: ComponentType
,
options?: BootstrapOptions,
) {
const { proxy, renderMode } = options ?? {}
if (isStandalone()) {
return function Component(props: any) {
useEffect(() => {
connect(options)
}, [])
return (