'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { HoverShineOverlay } from '@/components/ui/HoverShineOverlay'; interface LanguageSwitcherProps { mobile?: boolean; isSolidMode?: boolean; } export function LanguageSwitcher({ mobile = false, isSolidMode = false }: LanguageSwitcherProps) { const pathname = usePathname() || '/'; const currentLocale = pathname.startsWith('/en') ? 'en' : 'de'; const getSwitchedUrl = (newLocale: string) => { const pathWithoutLocale = pathname.replace(/^\/(en|de)/, ''); return `/${newLocale}${pathWithoutLocale === '' ? '' : pathWithoutLocale}`; }; const locales = [ { code: 'de', label: 'DE', fullLabel: 'Deutsch', flag: '🇩🇪' }, { code: 'en', label: 'EN', fullLabel: 'English', flag: '🇬🇧' }, ] as const; if (mobile) { return (