// sc-app.jsx — シングルページ描画（window.SC_PAGE で制御）

const navigate = (id) => { window.location.href = pageUrl(id); };

function App() {
  const page = window.SC_PAGE || "home";
  const pages = {
    home:    <HomePage    navigate={navigate} />,
    begin:   <BeginPage   navigate={navigate} />,
    course:  <CoursePage  navigate={navigate} />,
    voice:   <VoicePage   navigate={navigate} />,
    bio:     <BioPage     navigate={navigate} />,
    contact: <ContactPage navigate={navigate} />,
    policy:  <PolicyPage />,
    law:     <LawPage />,
  };

  return (
    <div>
      <Nav currentPage={page} />
      <main>{pages[page] || pages.home}</main>
      <Footer />
    </div>
  );
}

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