/* Fluffy Friends — app root & routing */ const { HomePage, AboutPage, ContactPage, BookingPage, Header, Footer, WhatsAppFab } = window; function App() { const [page, setPage] = React.useState(() => (location.hash.replace('#', '').split('?')[0]) || 'home'); const [bookPet, setBookPet] = React.useState(null); // routing const nav = (to, anchor) => { setPage(to); history.replaceState(null, '', '#' + to); requestAnimationFrame(() => { if (anchor) { const el = document.getElementById(anchor); if (el) { el.scrollIntoView({ behavior: 'smooth', block: 'start' }); return; } } window.scrollTo({ top: 0, behavior: 'smooth' }); }); }; React.useEffect(() => { const fn = () => setPage((location.hash.replace('#', '').split('?')[0]) || 'home'); window.addEventListener('hashchange', fn); return () => window.removeEventListener('hashchange', fn); }, []); // "Book a groom" everywhere → the full booking page (optionally pre-selecting a pet). const openBook = (pet) => { setBookPet(typeof pet === 'string' ? pet : null); nav('book'); }; // Staff login hands off to the real internal dashboard (FastAPI /login). const goStaff = () => { window.location.href = '/login'; }; return (
{page === 'book' ? : page === 'about' ? : page === 'contact' ? : }
); } ReactDOM.createRoot(document.getElementById('root')).render();