Certificate manager built on Laravel 13, Livewire 4, and Flux. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
47 lines
1.7 KiB
PHP
47 lines
1.7 KiB
PHP
<?php
|
|
|
|
use App\Enums\Locale;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Livewire\Attributes\Title;
|
|
use Livewire\Component;
|
|
|
|
new #[Title('Appearance settings')] class extends Component {
|
|
/**
|
|
* @return array<int, Locale>
|
|
*/
|
|
public function locales(): array
|
|
{
|
|
return Locale::cases();
|
|
}
|
|
}; ?>
|
|
|
|
<section class="w-full">
|
|
@include('partials.settings-heading')
|
|
|
|
<flux:heading class="sr-only">{{ __('Appearance settings') }}</flux:heading>
|
|
|
|
<x-pages::settings.layout :heading="__('Appearance')" :subheading="__('Update the appearance settings for your account')">
|
|
<flux:radio.group x-data variant="segmented" x-model="$flux.appearance">
|
|
<flux:radio value="light" icon="sun">{{ __('Light') }}</flux:radio>
|
|
<flux:radio value="dark" icon="moon">{{ __('Dark') }}</flux:radio>
|
|
<flux:radio value="system" icon="computer-desktop">{{ __('System') }}</flux:radio>
|
|
</flux:radio.group>
|
|
|
|
<flux:separator class="my-6" />
|
|
|
|
<flux:heading>{{ __('Language') }}</flux:heading>
|
|
<flux:subheading class="mb-4">{{ __('Choose the language used throughout the application') }}</flux:subheading>
|
|
|
|
<div class="inline-flex gap-1 rounded-lg bg-zinc-100 p-1 dark:bg-zinc-700">
|
|
@foreach ($this->locales() as $locale)
|
|
<flux:button
|
|
:href="route('language.switch', $locale->value)"
|
|
:variant="Auth::user()->locale === $locale->value ? 'primary' : 'ghost'"
|
|
size="sm"
|
|
>
|
|
{{ $locale->label() }}
|
|
</flux:button>
|
|
@endforeach
|
|
</div>
|
|
</x-pages::settings.layout>
|
|
</section>
|