/* JAM — App router & glue */
const { useState: useStateApp, useEffect: useEffectApp } = React;
function App() {
const [hash, setHash] = useStateApp(() => window.location.hash.replace(/^#\/?/, "") || "");
const [locale, setLocale] = useStateApp("EN");
useEffectApp(() => {
const onHash = () => {
setHash(window.location.hash.replace(/^#\/?/, "") || "");
window.scrollTo({ top: 0, behavior: "instant" });
};
window.addEventListener("hashchange", onHash);
return () => window.removeEventListener("hashchange", onHash);
}, []);
const goto = (route) => {
window.location.hash = "#/" + (route || "");
};
const openWedding = (id) => {
window.location.hash = "#/real-weddings/" + id;
};
// Parse route
const [primary, sub] = hash.split("/");
const route = primary || "";
let view;
if (route === "" || route === "home") {
view = ;
} else if (route === "real-weddings" && sub) {
view = ;
} else if (route === "real-weddings") {
view = ;
} else if (route === "services") {
view = ;
} else if (route === "venues") {
view = ;
} else if (route === "about") {
view = ;
} else if (route === "testimonials") {
view = ;
} else if (route === "contact") {
view = ;
} else {
view = ;
}
return (
{view}
);
}
ReactDOM.createRoot(document.getElementById("root")).render();