// ===== App Root + Router =====
function App() {
  const route = useHashRoute();
  const { path, params } = route;

  let page;
  switch (path) {
    case "beranda": page = <PageBeranda />; break;
    case "fauna": page = <PageFauna slug={params[0]} />; break;
    case "fasilitas": page = <PageFasilitas slug={params[0]} />; break;
    case "tiket": page = <PageTiket />; break;
    case "kontak": page = <PageKontak />; break;
    case "tentang": page = <PageTentang />; break;
    case "galeri": page = <PageGaleri />; break;
    case "faq": page = <PageFAQ />; break;
    case "edukasi": page = <PageEdukasi />; break;
    case "lokasi": page = <PageLokasi />; break;
    case "konservasi": page = <PageKonservasi />; break;
    default: page = <NotFound />;
  }

  return (
    <>
      <Nav />
      <main>{page}</main>
      <Footer />
    </>
  );
}

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