import { lazy, Suspense, useEffect } from 'react'; import { BrowserRouter as Router, Routes, Route, Navigate, useLocation } from 'react-router-dom'; import '../scss/App.scss'; import Navbar from '../components/layout/Navigation'; import Footer from '../components/layout/Footer'; import BackToTopButton from '../components/BackToTopButton'; import { useLanguage } from '../contexts/LanguageContext'; const HomePage = lazy(() => import('../pages/HomePage')); const LandingPage = lazy(() => import('../pages/LandingPage')); const AuditPage = lazy(() => import('../pages/AuditPage')); const QuickcheckPage = lazy(() => import('../pages/QuickcheckPage')); const ImprintPage = lazy(() => import('../pages/ImprintPage')); const PrivacyPolicy = lazy(() => import('../pages/PrivacyPolicy')); function LegacyLanguageRedirect() { const { setLanguage } = useLanguage(); const location = useLocation(); const legacyLanguage = location.pathname.startsWith('/en') ? 'en' : 'de'; const targetPathname = location.pathname.replace(/^\/(de|en)(?=\/|$)/, '') || '/'; useEffect(() => { setLanguage(legacyLanguage); }, [legacyLanguage, setLanguage]); return ( ); } function AppShell() { const location = useLocation(); const { texts } = useLanguage(); useEffect(() => { const hash = location.hash.substring(1); if (hash) { setTimeout(() => { const element = document.getElementById(hash); if (element) { element.scrollIntoView({ behavior: 'smooth' }); } }, 100); } }, [location.hash]); return (
{texts.accessibility.skipLinks.skipToHero}
Loading…

}> {/* Legacy locale-prefixed URLs → clean URLs */} } /> } /> {/* Canonical, language-neutral routes */} } /> } /> } /> } /> {/* Shared pages (noindex, language-independent) */} } /> } /> } />
); } function AppRouter() { return ( ); } export default AppRouter;