/* global React, ReactDOM, Nav, Footer, ContactModal, Home, Page */
const { useState: useStateApp } = React;

function App() {
  const [contact, setContact] = useStateApp(false);
  const open = () => setContact(true);
  const isHome = !window.HCDI_PAGE || window.HCDI_PAGE === "home";
  return (
    <React.Fragment>
      <Nav onContact={open} />
      {isHome ? <Home onContact={open} /> : <Page onContact={open} />}
      <Footer />
      <ContactModal open={contact} onClose={() => setContact(false)} />
    </React.Fragment>
  );
}

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