import { lazy, Suspense } from 'react' import { Routes, Route, Navigate } from 'react-router' import { LoadingPage, AppErrorBoundary } from './components/ui' import { AppShell } from './components/layout' import { ProtectedRoute } from './components/auth' import { WorkspaceType } from './domain/enums' import { useSessionStore } from './stores/sessionStore' import { AGENT_SECTIONS, AGENT_SECTION_PARAM, ROUTES } from './lib/constants' // Die Flächensuche ist entfernt — es bleibt ein einziger erreichbarer Einstieg. // Seit Runde 5 ist das die Startseite; die frühere «Übersicht» existiert nicht mehr. const WORKSPACE_HOME: Record = { [WorkspaceType.SUPPLY]: ROUTES.SUPPLY.PROPERTIES, } function RoleRedirect() { const currentUser = useSessionStore(s => s.currentUser) const first = currentUser?.allowedWorkspaces[0] ?? WorkspaceType.SUPPLY return } const LoginScreen = lazy(() => import('./pages/auth/LoginScreen')) const Properties = lazy(() => import('./pages/supply/Properties')) const MatchCenter = lazy(() => import('./pages/supply/MatchCenter')) const FutureAvailability = lazy(() => import('./pages/supply/FutureAvailability')) const DataQuality = lazy(() => import('./pages/supply/DataQuality')) const ReminderManager = lazy(() => import('./pages/supply/ReminderManager')) const MarketIntelligence = lazy(() => import('./pages/supply/MarketIntelligence')) const NewListing = lazy(() => import('./pages/supply/NewListing')) const MyListings = lazy(() => import('./pages/supply/MyListings')) const Besichtigungen = lazy(() => import('./pages/supply/Besichtigungen')) // Property On — «Meine Agenten» const MeineAgenten = lazy(() => import('./pages/supply/MeineAgenten')) /** Alter Unterseitenpfad → Reiter der Hauptseite. Hält Lesezeichen am Leben. */ function TeamSectionRedirect({ section }: { section: string }) { return } function App() { return ( }> {/* Public */} } /> {/* Protected: auth check only */} }> }> } /> {/* Supply Workspace */} }> {/* Runde 5, §2.1: Die Hauptseite «Übersicht» ist entfernt. Der alte Pfad bleibt als Umleitung bestehen, damit Lesezeichen und Deep Links auf der Startseite landen statt im Nichts. */} } /> } /> {/* Objekt-Detailroute — Ziel aller Objektlinks der Agentenseiten. */} } /> } /> } /> } /> {/* Die fünf Agentenseiten. Vier behalten den Pfad ihres Vorgängers. */} } /> } /> } /> } /> } /> {/* Property On — «Meine Agenten». Die drei Verwaltungsbereiche sind seit Runde 4 Reiter derselben Seite; die alten Unterseitenpfade leiten dorthin um, damit bestehende Lesezeichen nicht brechen. */} } /> } /> } /> } /> } /> ) } export default App