Files
Hotel-Booking/Frontend/src/routes/publicRoutes.tsx
Iliyan Angelov 627959f52b updates
2025-11-23 18:59:18 +02:00

51 lines
2.2 KiB
TypeScript

/**
* Public Routes
*
* Routes accessible to all users (authenticated and unauthenticated)
*/
import { lazy } from 'react';
import { RouteObject } from 'react-router-dom';
const HomePage = lazy(() => import('../pages/HomePage'));
const RoomListPage = lazy(() => import('../pages/customer/RoomListPage'));
const RoomDetailPage = lazy(() => import('../pages/customer/RoomDetailPage'));
const SearchResultsPage = lazy(() => import('../pages/customer/SearchResultsPage'));
const AboutPage = lazy(() => import('../pages/AboutPage'));
const ContactPage = lazy(() => import('../pages/ContactPage'));
const PrivacyPolicyPage = lazy(() => import('../pages/PrivacyPolicyPage'));
const TermsPage = lazy(() => import('../pages/TermsPage'));
const RefundsPolicyPage = lazy(() => import('../pages/RefundsPolicyPage'));
const CancellationPolicyPage = lazy(() => import('../pages/CancellationPolicyPage'));
const AccessibilityPage = lazy(() => import('../pages/AccessibilityPage'));
const FAQPage = lazy(() => import('../pages/FAQPage'));
const PaymentResultPage = lazy(() => import('../pages/customer/PaymentResultPage'));
const PayPalReturnPage = lazy(() => import('../pages/customer/PayPalReturnPage'));
const PayPalCancelPage = lazy(() => import('../pages/customer/PayPalCancelPage'));
const publicRoutes: RouteObject[] = [
{
path: '/',
children: [
{ index: true, element: <HomePage /> },
{ path: 'rooms', element: <RoomListPage /> },
{ path: 'rooms/search', element: <SearchResultsPage /> },
{ path: 'rooms/:room_number', element: <RoomDetailPage /> },
{ path: 'payment-result', element: <PaymentResultPage /> },
{ path: 'payment/paypal/return', element: <PayPalReturnPage /> },
{ path: 'payment/paypal/cancel', element: <PayPalCancelPage /> },
{ path: 'about', element: <AboutPage /> },
{ path: 'contact', element: <ContactPage /> },
{ path: 'privacy', element: <PrivacyPolicyPage /> },
{ path: 'terms', element: <TermsPage /> },
{ path: 'refunds', element: <RefundsPolicyPage /> },
{ path: 'cancellation', element: <CancellationPolicyPage /> },
{ path: 'accessibility', element: <AccessibilityPage /> },
{ path: 'faq', element: <FAQPage /> },
],
},
];
export default publicRoutes;