summaryrefslogtreecommitdiff
path: root/frontend/src/main.tsx
blob: 9527d8fc35e985ac73f10f3c2fef8c08ae75d80c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from 'react'
import ReactDOM from 'react-dom/client'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import App from './App'
import { DaemonList } from './components/DaemonList'
import { DaemonDetail } from './components/DaemonDetail'
import { DocumentLayout } from './components/document'
import './styles/pc98.css'
import './styles/mobile.css'

// Route configuration:
// Primary (Document UI - when feature flag enabled):
// - /directives - Document layout with file tree sidebar and Lexical editor
// - /directives/:id - Open a specific directive in the document editor
//
// Legacy (Contract UI - kept for backward compatibility):
// - /contracts - List all contracts
// - /contracts/:id - View contract details with tabs (including Files tab)
// - /contracts/:contractId/files/:fileId - View a specific file within contract context
//
// Note: When Document UI is enabled via Settings, /directives is the primary interface.
// The /contracts routes remain available as a legacy fallback.

const router = createBrowserRouter([
  {
    path: '/',
    element: <App />,
  },
  {
    path: '/daemons',
    element: <DaemonList />,
  },
  {
    path: '/daemons/:id',
    element: <DaemonDetail />,
  },
  {
    path: '/directives',
    element: <DocumentLayout />,
  },
  {
    path: '/directives/:id',
    element: <DocumentLayout />,
  },
])

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>
)