import { StrictMode, useEffect } from 'react' import { createRoot } from 'react-dom/client' import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom' function ScrollToTop() { const { pathname } = useLocation(); useEffect(() => { window.scrollTo(0, 0); }, [pathname]); return null; } import { ThemeProvider } from './context/ThemeContext' import { AuthProvider } from './context/AuthContext' import { LocationProvider } from './context/LocationContext' import { UIProvider } from './context/UIContext' import { CountryProvider } from './context/CountryContext' import GlobalAuthModal from './components/GlobalAuthModal' import CountrySelectModal from './components/CountrySelectModal' import './index.css' import App from './App.tsx' import AllCaregivers from './pages/AllCaregivers.tsx' import CaregiverDetail from './pages/CaregiverDetail.tsx' import JobDetail from './pages/JobDetail.tsx' import AllJobs from './pages/AllJobs.tsx' import SafetyTips from './pages/SafetyTips.tsx' import { SubscriptionProvider } from './context/SubscriptionContext' import { UnlockProvider } from './context/UnlockContext' import { CaregiversProvider } from './context/CaregiversContext' import { JobListingsProvider } from './context/JobListingsContext' import { ContactRequestProvider } from './context/ContactRequestContext' import { MessagesProvider } from './context/MessagesContext' import { NotificationsProvider } from './context/NotificationsContext' import Pricing from './pages/Pricing.tsx' import ResumeTips from './pages/ResumeTips.tsx' import Resources from './pages/Resources.tsx' import PrivacyPolicy from './pages/PrivacyPolicy.tsx' import TermsOfService from './pages/TermsOfService.tsx' import CookiesPolicy from './pages/CookiesPolicy.tsx' import AboutUs from './pages/AboutUs.tsx' import CaregiverApply from './pages/CaregiverApply.tsx' import ApplyLanding from './pages/ApplyLanding.tsx' import FamilyApply from './pages/FamilyApply.tsx' import FamilyApplyLanding from './pages/FamilyApplyLanding.tsx' import FreelanceCaregiverApply from './pages/FreelanceCaregiverApply.tsx' import JoinPage from './pages/JoinPage.tsx' import VerifyReference from './pages/VerifyReference.tsx' import ResetPassword from './pages/ResetPassword.tsx' // Dashboard shell import DashboardLayout from './components/dashboard/DashboardLayout.tsx' // Role-aware router import DashboardRouter from './pages/dashboard/DashboardRouter.tsx' // Family pages import FamilyJobPosts from './pages/dashboard/family/FamilyJobPosts.tsx' import FamilySavedCaregivers from './pages/dashboard/family/FamilySavedCaregivers.tsx' import FamilyMessages from './pages/dashboard/family/FamilyMessages.tsx' import FamilyNotifications from './pages/dashboard/family/FamilyNotifications.tsx' import FamilySubscription from './pages/dashboard/family/FamilySubscription.tsx' // Caregiver pages import CaregiverListing from './pages/dashboard/caregiver/CaregiverListing.tsx' import CaregiverJobMatches from './pages/dashboard/caregiver/CaregiverJobMatches.tsx' import CaregiverReviews from './pages/dashboard/caregiver/CaregiverReviews.tsx' import CaregiverPhotos from './pages/dashboard/caregiver/CaregiverPhotos.tsx' import CaregiverReferences from './pages/dashboard/caregiver/CaregiverReferences.tsx' import CaregiverSubscription from './pages/dashboard/caregiver/CaregiverSubscription.tsx' import CaregiverListingPicker from './pages/dashboard/caregiver/CaregiverListingPicker.tsx' import CaregiverFreelanceListing from './pages/dashboard/caregiver/CaregiverFreelanceListing.tsx' import CaregiverBrowseJobs from './pages/dashboard/caregiver/CaregiverBrowseJobs.tsx' import CaregiverJobDetail from './pages/dashboard/caregiver/CaregiverJobDetail.tsx' import CaregiverSavedJobs from './pages/dashboard/caregiver/CaregiverSavedJobs.tsx' import ProfileView from './pages/dashboard/ProfileView.tsx' import { useAuth } from './context/AuthContext.tsx' function SubscriptionPage() { const { user } = useAuth(); return user?.role === 'caregiver' ? : ; } createRoot(document.getElementById('root')!).render( } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> {/* ── Join (subscribe + register) ── */} } /> {/* ── Standalone caregiver application form (no nav/auth) ── */} } /> } /> } /> {/* ── Family job request form ── */} } /> } /> } /> {/* ── Freelance caregiver sign-up form ── */} } /> } /> {/* ── Both (regular + freelance) caregiver sign-up ── */} } /> } /> } /> } /> } /> } /> } /> {/* ── Dashboard (role-adaptive) ───────────────────────── */} }> } /> } /> } /> } /> } /> {/* Family-only */} } /> } /> } /> {/* Caregiver-only */} } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> , )