@extends('layouts.app') @section('title', $user->name . ' โ€” Profil') @section('page-title', '๐Ÿ‘ค Profil') @section('content') {{-- Hero Profil --}}
{{ strtoupper(substr($user->name, 0, 1)) }}

{{ $user->name }}

{{ $user->role }}
๐Ÿ“ง {{ $user->email }}
@if($user->nim)
๐Ÿชช {{ $user->nim }}
@endif
๐Ÿ“… Bergabung {{ $user->created_at->format('M Y') }}
{{-- Kolom Bio --}} @if($user->bio)

{{ $user->bio }}

@endif
{{-- Stats row --}}
{{ number_format($user->total_points) }}
Total Poin
{{ $user->posts->count() }}
Diskusi
{{ $verifiedAnswersCount }}
Verified Jawaban
{{ $user->uploads->count() }}
Materi Upload
{{ $user->badges->count() }}
Badge
{{-- Edit profil (hanya diri sendiri) --}} @if(auth()->id() === $user->id)
{{-- Tombol edit bisa diarahkan ke halaman edit jika sudah ada --}} // profil kamu
@endif
{{-- Kolom kiri: Diskusi & Materi terbaru --}}
{{-- Diskusi Terbaru --}} {{-- Materi yang diupload (dosen/admin) --}} @if($user->isDosen() || $user->isAdmin())

๐Ÿ“š Materi Diupload

@forelse($user->uploads as $mat) {{ $mat->type_icon }}
{{ $mat->title }}
{{ $mat->course->name ?? '-' }} ยท {{ $mat->file_size_formatted }} ยท โฌ‡ {{ $mat->download_count }}x
@empty
Belum ada materi yang diunggah.
@endforelse
@endif
{{-- Kolom kanan: Badge --}}

๐ŸŽ–๏ธ Badge Diraih

{{ $user->badges->count() }} badge
@forelse($user->badges as $ub)
{{ $ub->badge->icon }}
{{ $ub->badge->name }}
{{ $ub->badge->description }}
{{ $ub->awarded_at?->format('d M Y') }}
@empty
๐ŸŒฑ

Belum ada badge.

Lihat semua badge
@endforelse
{{-- Check-in streak info --}}

๐Ÿ”ฅ Aktivitas

@php $totalCheckins = $user->checkIns()->count(); $lastCheckIn = $user->checkIns()->latest()->first(); @endphp
Total check-in {{ $totalCheckins }}x
Check-in terakhir {{ $lastCheckIn ? $lastCheckIn->created_at->diffForHumans() : '-' }}
Total poin โšก {{ number_format($user->total_points) }}
@endsection