import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
import App from './App.jsx';
import './myStyle.css'
import ErrorPage from './pages/ErrorPage.jsx';
import MainPage from './pages/MainPage.jsx';
import Galery from './pages/Galery.jsx';
import Courses from './pages/Courses.jsx';
import Contacts from './pages/Contacts.jsx';
import Reviews from './pages/Reviews.jsx';
import Admin from './pages/Admin.jsx';
import PageEdit from './pages/page-edit.jsx';

const routes = [
    {
        index: true,
        path: '/',
        element: <MainPage />,
        title: 'Главная',
    },
    {
        path: '/Galery',
        element: <Galery />,
        title: 'Галерея',
    },
    {
        path: '/Courses',
        element: <Courses />,
        title: 'Курсы',
    },
    {
        path: '/Contacts',
        element: <Contacts />,
        title: 'Контакты',
    },
    {
        path: '/Reviews',
        element: <Reviews />,
        title: 'Отзывы',
    },
    {
        path: '/Admin',
        element: <Admin />,
        title: 'Админ',
    },
    {
        path: '/page-edit',
        element: <PageEdit />,
    },
];

const router = createBrowserRouter([
    {
        path: '/',
        element: <App routes={routes} />,
        children: routes,
        errorElement: <ErrorPage />,
    },
]);

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