{{-- Backdrop --}} @if ($showSlideOver)
@endif {{-- Slide-over Panel --}}
{{-- Header --}}

{{ $isEditing ? 'Edit User' : 'Add User' }}

{{-- Tabs (edit mode only) --}} @if ($isEditing)
@endif {{-- Details Tab --}}
{{-- First Name --}}
@error('first_name')

{{ $message }}

@enderror
{{-- Last Name --}}
@error('last_name')

{{ $message }}

@enderror
{{-- Email --}}
@error('email')

{{ $message }}

@enderror
{{-- Phone --}}
@error('phone')

{{ $message }}

@enderror
{{-- Role --}}
@error('role')

{{ $message }}

@enderror
{{-- Clinician Code --}} @if ($role === 'clinician')
@error('clinician_code')

{{ $message }}

@enderror
@endif {{-- Creation Method (create mode only) --}} @if (! $isEditing)

Account Setup Method

{{-- Temporary Password Field --}} @if ($creation_method === 'password')
{{-- Toggle visibility --}} {{-- Copy --}} {{-- Generate --}}

Min 8 characters, must include uppercase, lowercase, and a number.

@error('temp_password')

{{ $message }}

@enderror
@endif {{-- Force password change --}} @endif {{-- Edit Mode Actions --}} @if ($isEditing && $editingUser)

Account Actions

{{-- Disable / Enable (hidden for admin users) --}} @if (! $this->isEditingAdmin()) @if ($editingUser->isDisabled()) @else @endif @endif {{-- Reset Password --}} {{-- Resend Invite (pending users only) --}} @if ($editingUser->status === \App\Enums\UserStatus::Pending) @endif
@endif
{{-- Permissions Tab --}} @if ($isEditing && $activeTab === 'permissions')
@foreach ($permissionsByGroup as $group => $perms) @php $grantedCount = $perms->filter(fn ($p) => !empty($userPermissions[$p->id]))->count(); $allGranted = $grantedCount === $perms->count(); @endphp {{-- Group header --}}
{{ $group }}
{{-- Permission rows --}} @foreach ($perms as $perm) @php $isGranted = !empty($userPermissions[$perm->id]); @endphp

{{ $perm->description }}

{{ $perm->name }}

@endforeach @endforeach
@endif {{-- Footer --}}