import { createRoot } from 'react-dom/client';
import './index.css';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import { Layout } from './components/Layout';
import { MainPage } from './pages/MainPage';
import CookiesPage from './pages/CookiesPage';
import PolicyPage from './pages/PolicyPage';
import PrivacyPolicyPage from './pages/PrivacyPolicyPage';

createRoot(document.getElementById('root')!).render(
  <RouterProvider
    router={createBrowserRouter([
      {
        path: '/',
        Component: Layout,
        children: [
          {
            index: true,
            Component: MainPage,
          },
          {
            path: '/cookies',
            Component: CookiesPage,
          },
          {
            path: '/policy',
            Component: PolicyPage,
          },
          {
            path: '/privacy-policy',
            Component: PrivacyPolicyPage,
          },
        ],
      },
    ])}
  />,
);
