/* Shared HTML shell machinery for every secondary page.
   Usage from an HTML file:
     window.FORTIS_PAGE = { current: 'Services', component: () => <ServicesPage onBook={...}/> };
   (handled by the shell inline script)
*/
function PageApp({ PageComponent, current }) {
  const [modalOpen, setModalOpen] = React.useState(false);
  const { BookConsult, Page } = window;
  return (
    <>
      <Page onBook={() => setModalOpen(true)} current={current}>
        <PageComponent onBook={() => setModalOpen(true)} />
      </Page>
      {BookConsult && <BookConsult open={modalOpen} onClose={() => setModalOpen(false)} />}
    </>
  );
}
window.PageApp = PageApp;
