@php
$headerPhotoUrl = ($activeConversation && !empty($activeConversation->photo_path))
? '/storage/'.ltrim($activeConversation->photo_path, '/')
: null;
$headerTitle = $activeConversation
? (($activeConversation->type === 'group')
? ($activeConversation->title ?? $activeConversation->building?->name ?? 'Groupe')
: 'Discussion privée')
: 'Sélectionne une conversation';
@endphp
@if($headerPhotoUrl)

@else
@endif
{{ $headerTitle }}
@if($activeConversation && $activeConversation->type === 'group' && auth()->user()->isManager())
@php
$groupPhotoUrl = !empty($activeConversation->photo_path) ? '/storage/'.ltrim($activeConversation->photo_path, '/') : null;
$groupTitle = $activeConversation->title ?? $activeConversation->building?->name ?? 'Groupe';
@endphp
@endif
{{ $activeConversation ? $messages->count().' messages' : '' }}