import { Route, Routes, Navigate } from 'react-router-dom'; import { useAtomValue } from 'jotai'; import { Layout } from '../components/layout'; import { ThemeProvider } from '../components/theme-provider'; import { ProtectedRoute } from '../components/protected-route'; import { AdminRoute } from '../components/admin-route'; import { LoginForm } from '../components/login-form'; import { RegisterForm } from '../components/register-form'; import { OAuthCallback } from '../components/oauth-callback'; import { isAuthenticatedAtom } from '../atoms/auth-atoms'; import { HomeView, NotFoundView, ProjectsView, ProjectEditView, ProjectConfigView, TasksView, AnnotationsView, AnnotationView, UserManagementView, MyTasksView, ExternalProjectsView, } from '../views'; import { ProjectAnnotationView } from '../views/project-annotation-view'; import { EditorTest } from '../views/editor-test'; import { ToastContainer } from '../components/toast-container'; import { ErrorBoundary } from '../components/error-boundary'; /** * Annotation Platform Application * * This is the main application component for the annotation platform. * It provides routing and integrates with Layout component for * backend management UI style. * * Includes JWT authentication with protected routes. * * Requirements: 4.1, 4.2, 4.8, 7.3, 7.6, 10.1, 10.3, 10.5, 10.7, 1.1, 2.1, 4.1 */ export function App() { const isAuthenticated = useAtomValue(isAuthenticatedAtom); return ( {/* Public Routes - Login and Register */} : } /> : } /> } /> {/* Protected Routes - Require Authentication */} {/* Home Route */} } /> {/* Editor Test Route */} } /> {/* Projects Routes */} } /> } /> } /> } /> {/* External Projects Routes (Admin Only) */} } /> {/* Tasks Routes (Admin Only for /tasks) */} } /> } /> } /> {/* Annotations Routes */} } /> {/* User Management Routes (Admin Only) */} } /> {/* 404 Not Found */} } /> } /> {/* Global Toast Container */} ); } export default App;