/* App shell + router */ function App() { const [route, setRoute] = useState(() => parseHash(window.location.hash)); const [modal, setModal] = useState(null); // null | 'quote' | 'showroom' const [lang, setLang] = useState("en"); useEffect(() => { const onHash = () => setRoute(parseHash(window.location.hash)); window.addEventListener("hashchange", onHash); return () => window.removeEventListener("hashchange", onHash); }, []); const navigate = (r) => { const hash = toHash(r); if(window.location.hash !== hash) window.location.hash = hash; setRoute(r); window.scrollTo({top:0, behavior:"instant"}); }; const onQuote = () => setModal("quote"); const onShowroom = () => setModal("showroom"); let page; switch(route.page) { case "home": page = ; break; case "products": page = ; break; case "category": page = ; break; case "sectors": page = ; break; case "sector": page = ; break; case "projects": page = ; break; case "showroom": page = ; break; case "about": page = ; break; case "contact": page = ; break; default: page = ; } return ( <>