clusev/resources/views/livewire/settings/users.blade.php

55 lines
2.7 KiB
PHP

<div class="space-y-5">
<x-panel :title="__('accounts.title')" :subtitle="__('accounts.subtitle')">
<x-slot:actions>
<x-btn variant="accent" wire:click="create">
<x-icon name="user-plus" class="h-3.5 w-3.5" /> {{ __('accounts.create') }}
</x-btn>
</x-slot:actions>
<div class="divide-y divide-line">
@forelse ($users as $user)
@php $isSelf = $user->getKey() === $currentId; @endphp
<div class="flex flex-col gap-3 py-3 sm:flex-row sm:items-center">
<span @class([
'grid h-9 w-9 shrink-0 place-items-center rounded-md border',
'border-accent/30 bg-accent/10 text-accent-text' => $isSelf,
'border-line bg-inset text-ink-3' => ! $isSelf,
])>
<x-icon name="user-plus" class="h-4 w-4" />
</span>
<div class="min-w-0 flex-1">
<div class="flex flex-wrap items-center gap-2">
<p class="truncate text-sm text-ink">{{ $user->name }}</p>
@if ($isSelf)
<x-badge tone="accent">{{ __('accounts.you') }}</x-badge>
@endif
@if ($user->hasTwoFactorEnabled())
<x-badge tone="cyan">
<x-icon name="shield" class="h-3 w-3" /> {{ __('accounts.twofa_on') }}
</x-badge>
@else
<x-badge tone="neutral">{{ __('accounts.twofa_off') }}</x-badge>
@endif
</div>
<p class="truncate font-mono text-[11px] text-ink-3">{{ $user->email }}</p>
</div>
@unless ($isSelf)
<div class="flex shrink-0 items-center gap-2">
<x-btn variant="secondary" wire:click="confirmLogout({{ $user->getKey() }})">
<x-icon name="logout" class="h-3.5 w-3.5" /> {{ __('accounts.logout') }}
</x-btn>
<x-btn variant="danger-soft" wire:click="confirmRemove({{ $user->getKey() }})">
<x-icon name="trash" class="h-3.5 w-3.5" /> {{ __('accounts.remove') }}
</x-btn>
</div>
@endunless
</div>
@empty
<p class="py-3 font-mono text-[11px] text-ink-4">{{ __('accounts.none') }}</p>
@endforelse
</div>
</x-panel>
</div>