/* ============================================================ GlowMerald — Navigation, Footer, ProductCard ============================================================ */ const { useState:useStateN, useEffect:useEffectN } = React; const NAV_LINKS = [ { route:'shop', label:'Shop' }, { route:'insight', label:'Beauty Insight' }, { route:'about', label:'About' }, { route:'contact', label:'Contact' }, ]; /* ---- Top navigation ---- */ function NavBar(){ const { route, navigate, cartCount, wishlist, openSearch } = useApp(); const [scrolled,setScrolled] = useStateN(false); const [menu,setMenu] = useStateN(false); useEffectN(()=>{ const f=()=>setScrolled(window.scrollY>10); f(); window.addEventListener('scroll',f); return ()=>window.removeEventListener('scroll',f); },[]); const onHomeHero = route==='home' && !scrolled; const barStyle = { position:'sticky', top:0, zIndex:200, height:'var(--nav-h)', background: onHomeHero ? 'transparent' : 'rgba(250,247,240,.88)', backdropFilter: onHomeHero ? 'none' : 'saturate(140%) blur(10px)', borderBottom: onHomeHero ? '1px solid transparent' : '1px solid var(--line)', transition:'background .3s, border-color .3s', }; const ic = 'var(--ink)'; const dark = false; return ( <>
navigate('home')} className="nav-logo" style={{ display:'flex', cursor:'pointer' }}>
{menu && setMenu(false)}/>} ); } /* ---- Mobile drawer ---- */ function MobileMenu({ close }){ const { navigate } = useApp(); const go=(r,s)=>{ navigate(r,s); close(); }; return (
e.stopPropagation()}>

Glow from Within,
Confidence Revealed.

); } /* ---- Bottom navigation (mobile) ---- */ function BottomNav(){ const { route, navigate } = useApp(); const items=[ { r:'home', label:'Home', icon:'home' }, { r:'shop', label:'Shop', icon:'shop' }, { r:'insight', label:'Insight', icon:'book' }, { r:'account', label:'Akun', icon:'user' }, ]; return ( ); } /* ---- Footer ---- */ function Footer(){ const { navigate } = useApp(); return ( ); } /* ---- Shared Product Card ---- */ function ProductCard({ item, eager }){ const { navigate, addToCart, wishlist, toggleWishlist } = useApp(); const [adding,setAdding] = useStateN(false); const wished = wishlist.includes(item.id); const isBundle = item.type==='Bundle'; const add=(e)=>{ e.stopPropagation(); addToCart(item.id); setAdding(true); setTimeout(()=>setAdding(false),1400); }; return (
navigate('product',item.id)}> {item.bestSeller && Best Seller} {isBundle && Hemat {formatRp(item.was-item.price)}}
{item.type} {item.rating} · {item.reviews}
navigate('product',item.id)}>{item.name}
{formatRp(item.price)} {isBundle && {formatRp(item.was)}}
); } Object.assign(window, { NavBar, MobileMenu, BottomNav, Footer, ProductCard, NAV_LINKS });