import React from 'react'; import ReactDOM from 'react-dom/client'; import { createBrowserRouter, RouterProvider } from 'react-router-dom'; import App from './App.tsx'; import Login from './components/Login/Login.tsx'; import Register from './components/Register/Register.tsx'; import CustomerDashboard from './components/CustomerDashboard/CustomerDashboard.tsx'; import BookingQuery from './components/BookingQuery/BookingQuery.tsx'; import BookingList from './components/BookingList/BookingList.tsx'; import { GetCustomerDashboardData } from './services/CustomerDashboard/CustomerDashboard.ts'; import './index.scss'; import { GetBookingList } from './services/BookingList/BookingList.ts'; const router = createBrowserRouter([ { path: '/', element: <App></App>, children: [ { path: 'login', element: <Login></Login> }, { path: 'register', element: <Register></Register> }, { path: 'customer-dashboard', loader: GetCustomerDashboardData, element: <CustomerDashboard></CustomerDashboard> }, { path: 'booking/query', element: <BookingQuery></BookingQuery> }, { path: 'booking/list', loader: GetBookingList, element: <BookingList></BookingList> } ] } ]); ReactDOM.createRoot(document.getElementById('root')!).render( <React.StrictMode> <RouterProvider router={router}></RouterProvider> </React.StrictMode>, )