@props(['message']) @php $callData = json_decode($message->video_call_data, true) ?? []; $duration = $callData['duration'] ?? 0; $participants = $callData['participants'] ?? []; $callStatus = $callData['status'] ?? 'ended'; $startTime = $callData['start_time'] ?? null; $endTime = $callData['end_time'] ?? null; // Formatage de la durée $durationFormatted = ''; if ($duration > 0) { $hours = floor($duration / 3600); $minutes = floor(($duration % 3600) / 60); $seconds = $duration % 60; if ($hours > 0) { $durationFormatted = sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds); } else { $durationFormatted = sprintf('%02d:%02d', $minutes, $seconds); } } // Icône et couleur selon le statut $iconClass = 'fas fa-video'; $statusColor = 'text-gray-600'; $bgColor = 'bg-gray-100'; $statusText = 'Appel terminé'; switch ($callStatus) { case 'missed': $iconClass = 'fas fa-phone-slash'; $statusColor = 'text-red-600'; $bgColor = 'bg-red-100'; $statusText = 'Appel manqué'; break; case 'declined': $iconClass = 'fas fa-phone-slash'; $statusColor = 'text-red-600'; $bgColor = 'bg-red-100'; $statusText = 'Appel refusé'; break; case 'ended': $iconClass = 'fas fa-video'; $statusColor = 'text-green-600'; $bgColor = 'bg-green-100'; $statusText = 'Appel terminé'; break; case 'ongoing': $iconClass = 'fas fa-video animate-pulse'; $statusColor = 'text-blue-600'; $bgColor = 'bg-blue-100'; $statusText = 'Appel en cours'; break; } @endphp

Visioconférence

{{ $statusText }}

@if($callStatus === 'ongoing') @endif
@if($duration > 0)
Durée: {{ $durationFormatted }}
@endif @if(count($participants) > 0)
{{ count($participants) }} participant(s)
@foreach(array_slice($participants, 0, 4) as $participant)
@if(isset($participant['avatar'])) {{ $participant['name'] }} @else
@endif {{ $participant['name'] ?? 'Utilisateur' }}
@endforeach @if(count($participants) > 4)
+{{ count($participants) - 4 }}
@endif
@endif @if($startTime)
{{ \Carbon\Carbon::parse($startTime)->format('d/m/Y à H:i') }}
@endif
@if($callStatus === 'missed' && $message->sender_id !== auth()->id())
@elseif($callStatus === 'ended' && $duration > 0)
@if(isset($callData['recording_url'])) @endif
@endif
{{ $message->created_at->format('H:i') }} @if($message->sender_id === auth()->id())
@if($message->read_at) @else @endif
@endif
@push('scripts') @endpush @push('styles') @endpush