@php $isOwn = auth()->check() && ((int) ($comment->user_id ?? 0) === (int) auth()->id()); $isTopLevel = empty($comment->parent_id); $alignClass = $isTopLevel ? 'flex justify-start' : ($isOwn ? 'flex justify-end' : 'flex justify-start'); $bubbleClass = $isTopLevel ? 'bg-gray-50 text-gray-900 border border-gray-200' : ($isOwn ? 'bg-indigo-50 text-indigo-900 border border-indigo-200' : 'bg-gray-50 text-gray-900 border border-gray-200'); $timeClass = str_contains($bubbleClass, 'bg-indigo-50') ? 'text-indigo-700' : 'text-gray-600'; @endphp
{{ $comment->created_at?->diffForHumans() }}
{{ $comment->user->name ?? 'Pengguna' }}
{{ strip_tags($comment->body ?? '') }}
@auth @endauth @php $replyCount = $comment->children->count(); @endphp @if($replyCount > 0)
@endif @if($comment->children && $comment->children->count()) @endif