@extends('layouts.app') @section('title', __('ui.friends_title').' — Coaster World') @section('content')
{{ __('ui.friends_kicker') }}

{{ __('ui.friends_title') }}

{{ __('ui.friends_intro') }}

{{ $friends->count() }}{{ __('ui.friends_count') }}
{{ $incoming->count() }}{{ __('ui.friends_pending') }}
{{ $blocked->count() }}{{ __('ui.social_blocked_count') }}
@if(session('friend_status'))
{{ session('friend_status') }}
@endif @if(session('friend_error'))
{{ session('friend_error') }}
@endif
{{ __('ui.friends_find_kicker') }}

{{ __('ui.friends_find_title') }}

{{ __('ui.friends_find_intro') }}

@if($search !== '')
{{ __('ui.friends_results_kicker') }}

{{ __('ui.friends_results_title', ['query' => $search]) }}

@if($results->isNotEmpty())
@foreach($results as $candidate) @php $countryTranslation = $candidate->country?->translations?->firstWhere('locale', app()->getLocale()) ?? $candidate->country?->translations?->firstWhere('locale', 'en'); $countryName = $countryTranslation?->name ?: $candidate->country?->official_name; $profileVisible = $candidate->socialSettings?->activity_visibility === 'public' || $candidate->friend_state === 'friends'; @endphp
{{ mb_strtoupper(mb_substr($candidate->username ?: $candidate->name, 0, 1)) }}
{{ $candidate->username ? '@'.$candidate->username : $candidate->name }} @if($countryName)@endif
@endforeach
@else
{{ __('ui.friends_no_results_title') }}

{{ __('ui.friends_no_results_text') }}

@endif
@endif
@if($incoming->isNotEmpty() || $outgoing->isNotEmpty())
{{ __('ui.friends_received_kicker') }}

{{ __('ui.friends_received_title') }}

@if($incoming->isNotEmpty())
@foreach($incoming as $request) @php $sender = $request->sender; $countryTranslation = $sender?->country?->translations?->firstWhere('locale', app()->getLocale()) ?? $sender?->country?->translations?->firstWhere('locale', 'en'); @endphp
{{ $sender->username ? '@'.$sender->username : $sender->name }} @if($countryTranslation?->name || $sender?->country?->official_name)@else{{ __('ui.friends_explorer') }}@endif
@csrf
@csrf
@endforeach
@else

{{ __('ui.friends_received_empty') }}

@endif
{{ __('ui.friends_sent_kicker') }}

{{ __('ui.friends_sent_title') }}

@if($outgoing->isNotEmpty())
@foreach($outgoing as $request)
{{ $request->receiver?->username ? '@'.$request->receiver->username : $request->receiver?->name }} {{ __('ui.friends_state_sent') }}
@csrf @method('DELETE')
@endforeach
@else

{{ __('ui.friends_sent_empty') }}

@endif
@endif
{{ __('ui.friends_list_kicker') }}

{{ __('ui.friends_list_title') }}

{{ __('ui.friends_list_intro') }}

@if($friends->isNotEmpty())
@foreach($friends as $friend) @php $countryTranslation = $friend->country?->translations?->firstWhere('locale', app()->getLocale()) ?? $friend->country?->translations?->firstWhere('locale', 'en'); @endphp
{{ mb_strtoupper(mb_substr($friend->username ?: $friend->name, 0, 1)) }}
{{ $friend->username ? '@'.$friend->username : $friend->name }} @if($countryTranslation?->name || $friend->country?->official_name) @endif
@endforeach
@else
{{ __('ui.friends_empty_title') }}

{{ __('ui.friends_empty_text') }}

@endif
@if($blocked->isNotEmpty())
{{ __('ui.social_blocked_kicker') }}

{{ __('ui.social_blocked_title') }}

{{ __('ui.social_blocked_intro') }}

@foreach($blocked as $block) @php $blockedUser = $block->blocked; @endphp @if($blockedUser) @endif @endforeach
@endif @endsection