import React from 'react'
import ReactDOM from 'react-dom/client'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import MainLayout from './layouts/MainLayout'
import HomePage from './pages/HomePage'
import NewsPage from './pages/NewsPage'
import NewsDetailPage from './pages/NewsDetailPage'
import DatasetsPage from './pages/DatasetsPage'
import DirectoryPage from './pages/DirectoryPage'
import MatchmakingPage from './pages/MatchmakingPage'
import NotFoundPage from './pages/NotFoundPage'
import './index.css'

const router = createBrowserRouter([
  {
    path: "/",
    element: <MainLayout><HomePage /></MainLayout>
  },
  {
    path: "/news",
    element: <MainLayout><NewsPage /></MainLayout>
  },
  {
    path: "/news/:id",
    element: <MainLayout><NewsDetailPage /></MainLayout>
  },
  {
    path: "/datasets",
    element: <MainLayout><DatasetsPage /></MainLayout>
  },
  {
    path: "/directory",
    element: <MainLayout><DirectoryPage /></MainLayout>
  },
  {
    path: "/matchmaking",
    element: <MainLayout><MatchmakingPage /></MainLayout>
  },
  {
    path: "*",
    element: <MainLayout><NotFoundPage /></MainLayout>
  }
])

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