import React from 'react'
import ReactDOM from 'react-dom/client'
import {Outlet} from "react-router";
import {createHashRouter, RouterProvider} from "react-router-dom"
import {ListeResistants, resistantsLoader} from "./routes/Liste"
import NotFound from "./routes/NotFound";
import { PageResistant } from "./routes/PageResistant";
import './style/SquareSpace/vars.css'
import './style/SquareSpace/global.css'
import './style/SquareSpace/blocks.css'
import './style/SquareSpace/table.css'
import './style/SquareSpace/video.css'
import './style/thumbs.css'
import './style/row.css'
import './photos'

const Layout = () => <div>
    <Outlet />
</div>

const router = createHashRouter([{
    path: "/",
    element: <Layout />,
    errorElement: <NotFound />,
    children: [
        {
            path: "/",
            element: <ListeResistants/>,
            loader: resistantsLoader,
        },
        {
            path: ":nomResistant",
            element: <PageResistant/>,
            loader: resistantsLoader,
        }
    ]
}])


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