{{ __('Profil Saya') }}

{{-- Header Card --}}

{{ $user->name }} {{ $user->id }}

{{ $user->email }}

@if($user->alamat || $user->jorong || $user->kelompok)

@php $details = collect(); if ($user->jorong_label) { $details->push('Jorong: ' . $user->jorong_label); } if ($user->kelompok) { $details->push('Kelompok: ' . $user->kelompok->name); } if ($user->alamat) { $details->push('Alamat: ' . $user->alamat); } @endphp {{ $details->implode(' | ') }}

@endif
@php $totalFields = collect($sections)->sum(fn($s) => count($s['questions'])); $filledFields = collect($sections)->sum(function($s) use ($bioData) { return collect($s['questions'])->filter(fn($q) => isset($bioData[$q['key']]) && $bioData[$q['key']] !== '')->count(); }); $percent = $totalFields > 0 ? round(($filledFields / $totalFields) * 100) : 0; @endphp

Kelengkapan Bio

{{ $percent }}%
@if(auth()->user()->role === 'peserta') Edit Profil @endif
@if(session('success'))
{{ session('success') }}
@endif @if(empty($bioData))

Data Bio Belum Diisi

@if(auth()->user()->role === 'peserta')

Data biodata Anda belum diisi. Silakan lengkapi data bio Anda dengan menekan tombol di samping.

@else

Data biodata Anda belum diisi. Harap hubungi Kader atau Admin jorong Anda untuk melengkapi data bio Anda.

@endif
@if(auth()->user()->role === 'peserta') Lengkapi Bio @endif
@else
@foreach($sections as $section)

{{ $section['title'] }}

@foreach($section['questions'] as $q) @php $value = $bioData[$q['key']] ?? null; $isFilled = isset($bioData[$q['key']]) && $bioData[$q['key']] !== ''; @endphp
@if($isFilled)
@else
@endif

{{ $q['question'] }}

@if(!$isFilled) Belum diisi @elseif($q['type'] === 'boolean') {{ $value == '1' ? 'Ya' : 'Tidak' }} @else {{ $value }} @endif

@endforeach
@endforeach
@endif