@props([ 'message', // SupportMessage 'isOwner' => false, // true = mensaje del cliente que abrió el ticket ]) @php $author = $message->user; $isStaff = $author && $author->hasAnyRole(['System Admin', 'Administrator', 'Super Admin', 'Admin Comercial']); $authorName = $author ? trim(($author->first_name ?? '') . ' ' . ($author->last_name ?? '')) ?: $author->email : 'Sistema'; $align = $isOwner ? 'end' : 'start'; $bgClass = $isOwner ? 'bg-light-primary' : 'bg-light'; $borderClass = $isOwner ? 'border-primary' : ''; @endphp {{-- Mensaje individual de un thread de soporte — reusable client/admin. isOwner=true para mensajes del cliente; isOwner=false para staff/admin. --}}
@if($isStaff) {{ $authorName }} Soporte @else {{ $authorName }} @endif {{ $message->created_at->diffForHumans() }}
{{ $message->body }}