{{-- Sambutan (panel gradien) dan kartu identitas akademik: dua panel bersaudara, tidak bersarang. Slot = aksi cepat di sambutan. --}} @props(['user', 'details' => [], 'subtitle' => null]) @php $role = $user->role; $idLabel = $role->identifierLabel(); $idValue = $details[$idLabel] ?? null; $others = array_diff_key($details, [$idLabel => true]); $subtitle ??= "Anda masuk sebagai {$role->label()} di Sistem Informasi Akademik Universitas Tanjungpura."; $now = now()->locale('id'); $hour = (int) $now->format('G'); $sapaan = match (true) { $hour < 11 => 'Selamat pagi', $hour < 15 => 'Selamat siang', $hour < 18 => 'Selamat sore', default => 'Selamat malam', }; $icons = ['Username' => 'at-symbol', 'Jabatan' => 'briefcase', 'Unit kerja' => 'building-office-2', 'Program studi' => 'academic-cap', 'Fakultas' => 'building-library', 'Angkatan' => 'calendar-days', 'Status' => 'check-badge']; $initial = \Illuminate\Support\Str::of($user->name)->explode(' ')->filter()->take(2)->map(fn ($w) => \Illuminate\Support\Str::upper(\Illuminate\Support\Str::substr($w, 0, 1)))->implode(''); @endphp
class('welcome') }}>

Selamat Datang, {{ $user->name }}!

{{ $subtitle }}

@foreach (array_slice($others, 0, 3, true) as $label => $value) @continue($label === 'Username') {{ $label }}: {{ $value }} @endforeach @if (trim((string) $slot) !== '')
{{ $slot }}
@endif

Identitas akademik

{{ $user->name }}

@if ($idValue !== null)
{{ $idLabel }} {{ $idValue }}
@endif @if ($others)
@foreach ($others as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
@endif