// ============================================ // Hero — single static image, minimal welcome text. No slider. // Image path: assets/photos/hero/hero-menara-sunset.jpg // Falls back to a local photo if the file isn't on disk yet. // ============================================ const { useState: useStateHs, useEffect: useEffectHs } = React; const HERO_IMG = "assets/photos/hero/hero-riad.jpg?v=69"; const HERO_FALLBACK = "assets/photos/nobu-hotel-marrakech-marbella-review-683ddd3e251e9.avif"; function useResolvedHeroImage(primary, fallback) { const [src, setSrc] = useStateHs(primary); useEffectHs(() => { if (!primary || !fallback) return; const img = new Image(); let alive = true; img.onload = () => { if (alive) setSrc(primary); }; img.onerror = () => { if (alive) setSrc(fallback); }; img.src = primary; return () => { alive = false; }; }, [primary, fallback]); return src; } function HeroSlider() { const { useMS } = window.MS_CTX; const ctx = useMS(); const lang = ctx.lang || 'no'; const tx = (en, no, fr) => lang === 'no' ? no : lang === 'fr' ? fr : en; const bg = useResolvedHeroImage(HERO_IMG, HERO_FALLBACK); return (
); } window.MS_HeroSlider = HeroSlider;