/** * @license * SPDX-License-Identifier: Apache-2.0 */ import React, { useEffect, Suspense } from 'react'; import { HelmetProvider } from 'react-helmet-async'; import ReactDOM from 'react-dom/client'; import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom'; import './index.css'; import LandingPage from './components/LandingPage'; import CookieConsent from './components/CookieConsent'; import { LanguageProvider } from './src/i18n/LanguageContext'; import GeoRedirect from './src/i18n/GeoRedirect'; import LanguageRoute from './src/i18n/LanguageRoute'; // Lazy-loaded route components for code splitting const Login = React.lazy(() => import('./components/Login')); const Generator = React.lazy(() => import('./components/Generator')); const AdminPanel = React.lazy(() => import('./components/AdminPanel')); const UserSettings = React.lazy(() => import('./components/UserSettings')); const LegalPages = React.lazy(() => import('./components/LegalPages')); const ContactPage = React.lazy(() => import('./components/ContactPage')); const BlogListPage = React.lazy(() => import('./components/BlogListPage')); const BlogPost = React.lazy(() => import('./components/BlogPost')); const NotFoundPage = React.lazy(() => import('./components/NotFoundPage')); const DemoGenerator = React.lazy(() => import('./components/DemoGenerator')); const GscCallback = React.lazy(() => import('./components/GscCallback')); const GscDashboard = React.lazy(() => import('./components/GscDashboard')); const FeaturePage = React.lazy(() => import('./components/FeaturePage')); const FeaturesListPage = React.lazy(() => import('./components/FeaturesListPage')); // const ChatWidget = React.lazy(() => import('./components/ChatWidget')); function LoadingFallback() { return (