import React, { useEffect } from 'react'; import { Button } from '@/components/common/Button'; import { Logo } from './navbar/Logo'; import { URLS } from '@/lib/config/constants'; import type { Translation } from '@/types/i18n'; // Fonction utilitaire simple pour combiner les classes const cn = (...classes: (string | undefined | null | false)[]): string => { return classes.filter(Boolean).join(' '); }; interface MobileMenuProps { isOpen: boolean; onClose: () => void; translations: Translation['navigation']; } interface MobileNavItemProps { icon: React.ReactNode; title: string; description: string; href: string; isExternal?: boolean; onClick?: () => void; } const MobileNavItem: React.FC = ({ icon, title, description, href, isExternal = false, onClick }) => { const handleClick = (e: React.MouseEvent) => { if (onClick) { e.preventDefault(); onClick(); } }; return (
{icon}
{title}

{description}

{/* Arrow Icon */}
); }; export const MobileMenu: React.FC = ({ isOpen, onClose, translations }) => { // Gérer le scroll du body useEffect(() => { if (isOpen) { document.body.style.overflow = 'hidden'; } else { document.body.style.overflow = 'unset'; } return () => { document.body.style.overflow = 'unset'; }; }, [isOpen]); const handleNavClick = (sectionId: string) => { if (sectionId === 'home') { // Scroll to top for home section window.scrollTo({ top: 0, behavior: 'smooth' }); } else if (sectionId === 'contact') { // Open email client for contact window.location.href = 'mailto:contact@la-banquise.fr'; } else { // Scroll to specific section const element = document.getElementById(sectionId); if (element) { element.scrollIntoView({ behavior: 'smooth', block: 'start' }); } } onClose(); }; return (
{/* Overlay avec effet de blur moderne */}
{/* Menu Panel */}
{/* Header avec Logo */}
{/* Navigation Items */}
{/* Section Navigation */}
} title={translations.home} description="Retour à l'accueil" href="#home" onClick={() => handleNavClick('home')} /> } title={translations.services} description="Découvrir notre offre" href="#services" onClick={() => handleNavClick('services')} /> } title={translations.about} description="En savoir plus sur nous" href="#about" onClick={() => handleNavClick('about')} /> } title={translations.contact} description="Nous envoyer un email" href="mailto:contact@la-banquise.fr" onClick={() => handleNavClick('contact')} />
{/* Divider */}
{/* Social & External Links */}
} title="Discord" description="Rejoindre la communauté" href={URLS.social.discord} isExternal={true} />
{/* CTA Button */}
{/* Effet de gradient overlay */}
); };