import '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 './index.css';
import ErrorPage from './pages/ErrorPage.jsx';
import Page0 from './pages/Page0.jsx';
import Page1 from './pages/Page1.jsx';
import Page2 from './pages/Page2.jsx';
import Page3 from './pages/Page3.jsx';
import Page4 from './pages/Page4.jsx';
import PageEdit from './pages/PageEdit.jsx';
import Page5 from './pages/Page5.jsx';

const routes = [
  {
    index: true,
    path: '/page0',
    element: <Page0 />,
    //title: 'Главная',
  },
  {
    path: '/page1',
    element: <Page1 />,
    title: 'Фотогалерея',
  },
  {
    path: '/page2',
    element: <Page2 />,
    title: 'Контакты',
  },
  {
    path: '/page3',
    element: <Page3 />,
    title: 'Прейскурант',
  },
  {
    path: '/page4',
    element: <Page4 />,
    title: 'Отзывы',
  },
  {
    path: '/page5',
    element: <Page5/>,
    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>,
);
