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 (
{t.hero_desc}
{t.intro.desc}
{point.desc}
{t.lanyue.desc}
{t.aurora.desc}