import React, { useEffect } from 'react'; import Navbar from '@/src/components/Navbar.tsx'; import Sidebar from '@/src/components/Sidebar.tsx'; import Footer from '@/src/components/Footer.tsx'; import { CONTENT } from '../constants.ts'; import { useLanguage } from '@/src/contexts/LanguageContext.tsx'; import { useTheme } from '@/src/contexts/ThemeContext.tsx'; import { useLocation, Link } from 'react-router-dom'; import { ArrowRight, Anchor, Star, ChevronRight } from 'lucide-react'; const Ships: React.FC = () => { const { language } = useLanguage(); const { shipsPageImages } = useTheme(); // We explicitly type 'any' here or assume CONTENT structure is updated because // TS might not immediately pick up the new keys added to constants without a full types reload in this context. // In a real app, types.ts should be updated, but here we access the object properties. const t = CONTENT[language].shipsPage as any; const location = useLocation(); // Scroll to section on load or location change useEffect(() => { const params = new URLSearchParams(location.search); const section = params.get('section'); // Always scroll to top first if (!section) { window.scrollTo({ top: 0, behavior: 'smooth' }); } else { const element = document.getElementById(section); if (element) { // Small delay to ensure render setTimeout(() => { element.scrollIntoView({ behavior: 'smooth' }); }, 300); } } }, [location]); return (
{/* Hero Section */}
Ships Hero
{t.hero_sub}

{CONTENT[language].nav.menu[1].title}

{t.hero_desc}

{/* Section 1: Vista Series Intro */}
{/* Left: Text Content */}

{t.intro.title}

{t.intro.desc}

{t.intro.points.map((point: any, index: number) => (
0{index + 1}

{point.title}

{point.desc}

))}
{/* Right: Navigation Cards */}
Lanyue
{t.now_sailing} {t.lanyue.title}
Aurora
{t.coming_soon} {t.aurora.title}
{/* Divider */}
{/* Section 2: Vista Lanyue Details */}
{/* Background Decor */}
{t.flagship_label}

{t.lanyue.title}

{t.lanyue.desc}

{t.stats_tons}
{t.stats_stars}
1:1 {t.stats_ratio}
{/* Lanyue Image Grid (Masonry style) */}
{/* Large Hero Image */}
Lanyue Exterior
{/* Smaller Detail Images */}
Lanyue Interior
Lanyue Deck
Lanyue Wide
{t.view_itineraries}
{/* Section 3: Vista Aurora Teaser */}
Aurora
{t.future_label}

{t.aurora.title}

{t.aurora.desc}

); }; export default Ships;