/* eslint-disable no-undef */
/**
 * page-mount.jsx — single mount entry shared by all 5 site pages.
 *
 * Each HTML file sets window.__NS_PAGE__ to a key before loading scripts;
 * this script reads it and mounts the matching React page component into #root.
 */

const NS_PAGES = {
  home:     window.NsHomeA,
  content:  window.NsContentPage,
  guidance: window.NsGuidancePage,
  contact:  window.NsContactPage,
  privacy:  window.NsPrivacyPage,
};

const pageKey = window.__NS_PAGE__ || "home";
const PageComponent = NS_PAGES[pageKey];

const root = document.getElementById("root");

if (!PageComponent) {
  root.innerHTML = `<p style="padding:40px;font-family:sans-serif">No component registered for page key "${pageKey}".</p>`;
} else {
  ReactDOM.createRoot(root).render(<PageComponent />);
}
