import { createBrowserRouter, Navigate } from 'react-router-dom';

import { MainLayout } from './layouts/MainLayout';
import { HomePage } from './pages/HomePage';
import { ExamPage } from './pages/ExamPage';
import { BookingPage } from './pages/BookingPage';
import { SupportPage } from './pages/SupportPage';

export const router = createBrowserRouter([
  {
    path: '/',
    element: <MainLayout />,
    children: [
      { index: true, element: <Navigate to='/home' replace /> },
      { path: 'home', element: <HomePage /> },
      { path: 'exam', element: <ExamPage /> },
      { path: 'booking', element: <BookingPage /> },
      { path: 'support', element: <SupportPage /> },
    ],
  },
  { path: '*', element: <Navigate to='/home' replace /> },
]);


