app.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { Route, Routes } from 'react-router-dom';
  2. import { Layout } from '../components/layout';
  3. import { ThemeProvider } from '../components/theme-provider';
  4. import {
  5. HomeView,
  6. NotFoundView,
  7. ProjectsView,
  8. ProjectEditView,
  9. TasksView,
  10. AnnotationsView,
  11. AnnotationView,
  12. } from '../views';
  13. import { EditorTest } from '../views/editor-test';
  14. import { ToastContainer } from '../components/toast-container';
  15. import { ErrorBoundary } from '../components/error-boundary';
  16. /**
  17. * Annotation Platform Application
  18. *
  19. * This is the main application component for the annotation platform.
  20. * It provides routing and integrates with Layout component for
  21. * backend management UI style.
  22. *
  23. * Requirements: 4.1, 4.2, 4.8, 7.3, 7.6, 10.1, 10.3, 10.5, 10.7
  24. */
  25. export function App() {
  26. return (
  27. <ThemeProvider>
  28. <ErrorBoundary>
  29. <Layout>
  30. <Routes>
  31. {/* Home Route */}
  32. <Route path="/" element={<HomeView />} />
  33. {/* Editor Test Route */}
  34. <Route path="/editor-test" element={<EditorTest />} />
  35. {/* Projects Routes */}
  36. <Route path="/projects" element={<ProjectsView />} />
  37. <Route path="/projects/:id/edit" element={<ProjectEditView />} />
  38. {/* Tasks Routes */}
  39. <Route path="/tasks" element={<TasksView />} />
  40. <Route path="/tasks/:id/annotate" element={<AnnotationView />} />
  41. {/* Annotations Routes */}
  42. <Route path="/annotations" element={<AnnotationsView />} />
  43. {/* 404 Not Found */}
  44. <Route path="*" element={<NotFoundView />} />
  45. </Routes>
  46. </Layout>
  47. {/* Global Toast Container */}
  48. <ToastContainer />
  49. </ErrorBoundary>
  50. </ThemeProvider>
  51. );
  52. }
  53. export default App;