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 Page1 from './pages/Page1.jsx';
import Page2 from './pages/Page2.jsx';
import Page3 from './pages/Page3.jsx';
import Page4 from './pages/Page4.jsx';
import Page5 from './pages/Page5.jsx';
import Page6 from './pages/Page6.jsx';
import Page7 from './pages/Page7.jsx';
import Page8 from './pages/Page8.jsx';

const routes = [
  {
    index: true,
    path: '/',
    element: <Page1 />,
    title: 'Главная страница',
  },
  {
    path: '/page2',
    element: <Page2 />,
    title: 'Букеты',
  },
  {
    path: '/page3',
    element: <Page3 />,
    title: 'Прайс',
  },
  {
    path: '/page4',
    element: <Page4 />,
    title: 'Отзывы',
  },
  {
    path: '/page5',
    element: <Page5 />,
    title: 'Связаться с нами',
  },
  {
    path: '/page6',
    element: <Page6 />,
    title: 'Просмотр заявок',
  },
  {
    path: '/page7',
    element: <Page7 />,
    title: 'Редактирование',
  },
  {
    path: '/page8',
    element: <Page8 />,
    title: 'Добавить товар',
  },
];

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>,
);
