import React, { useEffect } from 'react'; import { Button } from '@/components/common/Button'; import { Logo } from './navbar/Logo'; import { URLS } from '@/lib/config/constants'; import { useTranslation } from '@/lib/hooks/useTranslation'; import { cn, createNavClickHandler, commonClasses } from '@/lib/utils'; import type { Translation } from '@/types/i18n'; 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 }) => { const { t } = useTranslation(); // Gérer le scroll du body - simplifié avec notre utilitaire useEffect(() => { const originalStyle = document.body.style.overflow; if (isOpen) { document.body.style.overflow = 'hidden'; } else { document.body.style.overflow = originalStyle || 'unset'; } return () => { document.body.style.overflow = originalStyle || 'unset'; }; }, [isOpen]); // Gestionnaire de navigation optimisé const handleNavClick = createNavClickHandler(onClose); // Configuration des icônes SVG - factorisation const icons = { home: ( ), services: ( ), about: ( ), contact: ( ), discord: ( ), user: ( ) }; return (
{/* Overlay avec effet de blur moderne */}
{/* Menu Panel */}
{/* Header avec Logo */}
{/* Navigation Items */}
{/* Section Navigation */}
handleNavClick('home')} /> handleNavClick('services')} /> handleNavClick('about')} /> handleNavClick('contact')} />
{/* Divider */}
{/* Social & External Links */}
{/* CTA Button */}
{/* Effet de gradient overlay */}
); };