// v3 main app with page state
function App() {
  const [currentPage, setCurrentPage] = React.useState('home');

  window.navigateTo = (page) => setCurrentPage(page);
  window.getCurrentPage = () => currentPage;

  return (
    <div>
      {currentPage === 'home' ? (
        <>
          <Announcement/>
          <Nav/>
          <main>
            <Hero/>
            <TrustStrip/>
            <Categories/>
            <BrandIntro/>
            <WhyChoose/>
            <PackSizes/>
            <SchoolOffice/>
            <Health/>
            <Gifting/>
            {/* <Bestsellers/> */}
            <FAQ/>
          </main>
          <Footer/>
        </>
      ) : currentPage === 'maintenance' ? (
        <MaintenancePage onBack={() => setCurrentPage('home')}/>
      ) : null}
    </div>
  );
}

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