/* global React */ const { useState, useEffect, useRef } = React; // ---------- Icon set ---------- const Icon = { Menu: (p) => , Close: (p) => , Arrow: (p) => , Phone: (p) => , Flame: (p) => ( ), FlameSmall: (p) => ( ), }; // ---------- Reveal on scroll ---------- function Reveal({ children, delay = 0, as: Tag = "div", className = "", ...rest }) { const ref = useRef(null); const [inView, setIn] = useState(false); useEffect(() => { const el = ref.current; if (!el) return; const io = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setTimeout(() => setIn(true), delay); io.disconnect(); } }, { threshold: 0.15 }); io.observe(el); return () => io.disconnect(); }, [delay]); return {children}; } // ---------- Nav (overlays hero on Home; solid on inner pages) ---------- function Nav({ active, solid = false }) { const [stuck, setStuck] = useState(solid); const [mopen, setMopen] = useState(false); useEffect(() => { if (solid) return; const onScroll = () => setStuck(window.scrollY > 60); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, [solid]); useEffect(() => { document.body.style.overflow = mopen ? 'hidden' : ''; }, [mopen]); const links = [ { href: "index.html", label: "Home", key: "home" }, { href: "menu.html", label: "Menu", key: "menu" }, { href: "story.html", label: "Our Story", key: "story" }, { href: "reservations.html", label: "Reservations", key: "reservations" }, ]; return ( Amara Indian Kitchen {links.map(l => ( {l.label} ))} 604 · 555 · 0100 Reserve a table setMopen(true)} aria-label="Open menu"> setMopen(false)} /> ); } // ---------- Footer ---------- function Foot() { return ( ); } Object.assign(window, { AmaraIcon: Icon, AmaraNav: Nav, AmaraFoot: Foot, AmaraReveal: Reveal });