migration wip
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { getLocaleFromPath, getLocalizedPath, t, type Locale } from '@/lib/i18n';
|
||||
import { getLocaleFromPath, getLocalizedPath, type Locale } from '@/lib/i18n';
|
||||
import { Button } from '@/components/ui';
|
||||
|
||||
export function LocaleSwitcher() {
|
||||
const pathname = usePathname();
|
||||
@@ -25,18 +26,20 @@ export function LocaleSwitcher() {
|
||||
<Link
|
||||
key={locale}
|
||||
href={href}
|
||||
className={`px-4 py-2 text-sm font-medium rounded-md transition-all ${
|
||||
isActive
|
||||
? 'bg-blue-600 text-white shadow-sm'
|
||||
: 'text-gray-700 hover:bg-gray-50 hover:text-gray-900'
|
||||
}`}
|
||||
aria-label={`Switch to ${label}`}
|
||||
locale={locale}
|
||||
passHref
|
||||
>
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<span className="text-base">{flag}</span>
|
||||
<span>{label}</span>
|
||||
</span>
|
||||
<Button
|
||||
variant={isActive ? 'primary' : 'ghost'}
|
||||
size="sm"
|
||||
className={`transition-all ${isActive ? 'shadow-sm' : ''}`}
|
||||
aria-label={`Switch to ${label}`}
|
||||
>
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<span className="text-base">{flag}</span>
|
||||
<span className="font-medium">{label}</span>
|
||||
</span>
|
||||
</Button>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user