/* Esselen Tribe — App router */

function App() {
  const [route] = useRoute();

  const renderRoute = () => {
    switch (route) {
      case 'home': return <HomePage />;

      case 'about': return <AboutLanding />;
      case 'about/reclaim': return <Reclaim />;
      case 'about/history': return <EsselenHistory />;
      case 'about/sacred': return <SacredLand />;
      case 'about/our-history': return <OurHistory />;
      case 'about/milestones': return <Milestones />;

      case 'departments': return <DepartmentsLanding />;
      case 'departments/council': return <TribalCouncil />;
      case 'departments/board': return <NonProfitBoard />;
      case 'departments/grants': return <GrantsManagement />;
      case 'departments/cultural': return <CulturalResources />;
      case 'departments/education': return <EducationCommittee />;

      case 'projects': return <ProjectsLanding />;
      case 'projects/news': return <NewsPage />;
      case 'projects/news/cbs-sunday-morning': return <NewsArticle />;
      case 'projects/events': return <EventsPage />;
      case 'projects/events/annual-pelican-gathering': return <EventDetail />;
      case 'projects/education': return <EducationPage />;
      case 'projects/education/youth-land-camps': return <EducationDetail />;
      case 'projects/jobs': return <JobsPage />;
      case 'projects/jobs/cultural-resources-field-lead': return <JobDetail />;
      case 'projects/conservation': return <ConservationPage />;

      case 'membership': return <MembershipLanding />;
      case 'membership/becoming': return <BecomingMember />;
      case 'membership/forms': return <MembershipForms />;
      case 'membership/login': return <MemberLogin />;

      case 'donate': return <DonatePage />;
      case 'contact': return <ContactPage />;

      default: return <HomePage />;
    }
  };

  return (
    <div>
      <TopNav route={route} />
      <main className="page" key={route}>
        {renderRoute()}
      </main>
      <Footer />
    </div>
  );
}

ReactDOM.createRoot(document.getElementById('root')).render(<App />);
