@extends('layouts.app') @section('title', 'Find Friends') @section('content')

Find Players

@auth Add players you've competed with as friends @else Discover elite gamers on the platform @endauth

@auth My Friends @else Join Community @endauth

@auth Players You've Competed With @else Top Elite Players @endauth

@if($suggestions->count() > 0)
@foreach($suggestions as $user)
{{ substr($user->username, 0, 2) }}

{{ $user->username }}

Level {{ $user->level }}

{{ number_format($user->xp) }} XP

Challenges Won: {{ $user->createdChallenges()->where('result', 'creator_win')->count() + $user->acceptedChallenges()->where('result', 'accepter_win')->count() }}
Tournaments: {{ $user->tournamentParticipations()->count() }}
Win Rate: {{ $user->agreement_rate }}%
@auth @php $mutualFriends = auth()->user()->getMutualFriends($user); @endphp @if($mutualFriends->count() > 0)

{{ $mutualFriends->count() }} mutual friend(s)

{{ $mutualFriends->pluck('username')->take(3)->implode(', ') }}{{ $mutualFriends->count() > 3 ? '...' : '' }}

@endif
@csrf
@else

Sign up to connect with this player

Join Agamec
@endauth
@endforeach
@if($suggestions->hasPages())
{{ $suggestions->links() }}
@endif @else
🎮

No Suggestions Available

Play some challenges or join tournaments to meet other players!

@endif
@endsection