summaryrefslogtreecommitdiff
path: root/frontend/src/main.tsx
blob: ba2e16bff3f1fd59ec9689236892f513cf03acf7 (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
52
53
import React from 'react'
import ReactDOM from 'react-dom/client'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import App from './App'
import { ContractList } from './components/ContractList'
import { ContractDetail } from './components/ContractDetail'
import { FileDetail } from './components/FileDetail'
import { DaemonList } from './components/DaemonList'
import { DaemonDetail } from './components/DaemonDetail'
import './styles/pc98.css'
import './styles/mobile.css'
import './styles/heisei.css'

// Route configuration:
// - /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: Standalone file routes (/files, /files/:id) have been removed.
// Files are now only accessible through their parent contract.

const router = createBrowserRouter([
  {
    path: '/',
    element: <App />,
  },
  {
    path: '/contracts',
    element: <ContractList />,
  },
  {
    path: '/contracts/:id',
    element: <ContractDetail />,
  },
  {
    path: '/contracts/:contractId/files/:fileId',
    element: <FileDetail />,
  },
  {
    path: '/daemons',
    element: <DaemonList />,
  },
  {
    path: '/daemons/:id',
    element: <DaemonDetail />,
  },
])

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