/**
 * Public Routes
 * 
 * Routes accessible to all users (authenticated and unauthenticated)
 */

import { lazy } from 'react';
import { RouteObject } from 'react-router-dom';

const HomePage = lazy(() => import('../features/content/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('../features/content/pages/AboutPage'));
const ContactPage = lazy(() => import('../features/content/pages/ContactPage'));
const PrivacyPolicyPage = lazy(() => import('../features/content/pages/PrivacyPolicyPage'));
const TermsPage = lazy(() => import('../features/content/pages/TermsPage'));
const RefundsPolicyPage = lazy(() => import('../features/content/pages/RefundsPolicyPage'));
const CancellationPolicyPage = lazy(() => import('../features/content/pages/CancellationPolicyPage'));
const AccessibilityPage = lazy(() => import('../features/content/pages/AccessibilityPage'));
const FAQPage = lazy(() => import('../features/content/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;

