29 lines
1.7 KiB
PHP
Executable File
29 lines
1.7 KiB
PHP
Executable File
<div x-data="{ langOpen: false }" class="relative">
|
|
<button @click="langOpen = !langOpen" @click.away="langOpen = false" type="button"
|
|
class="flex items-center gap-2 px-3 py-2 text-sm transition {{ $variant ?? 'text-gray-700 hover:text-gray-900' }}">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3.18 17.34" />
|
|
</svg>
|
|
<span class="hidden sm:inline">{{ strtoupper(app()->getLocale()) }}</span>
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-show="langOpen" x-cloak
|
|
class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 border border-gray-200">
|
|
<a href="{{ route('language.switch', 'pt_BR') }}"
|
|
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 {{ app()->getLocale() == 'pt_BR' ? 'bg-indigo-50 text-indigo-600' : '' }}">
|
|
🇧🇷 Português (Brasil)
|
|
</a>
|
|
<a href="{{ route('language.switch', 'en') }}"
|
|
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 {{ app()->getLocale() == 'en' ? 'bg-indigo-50 text-indigo-600' : '' }}">
|
|
🇺🇸 English
|
|
</a>
|
|
<a href="{{ route('language.switch', 'es') }}"
|
|
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 {{ app()->getLocale() == 'es' ? 'bg-indigo-50 text-indigo-600' : '' }}">
|
|
🇪🇸 Español
|
|
</a>
|
|
</div>
|
|
</div>
|