Comments {{ $comments->count() }}

@if($canComment)
@php $currentAvatar = $currentUserProfile ? $currentUserProfile->avatar_url : auth()->user()->avatar; $currentName = $currentUserProfile ? $currentUserProfile->display_name : auth()->user()->name; @endphp
{{ $currentName }}
@error('newComment') {{ $message }} @enderror
@endif
@forelse($comments as $comment) @php $commentProfile = $profiles->get($comment->user_id); $commentAvatar = $commentProfile ? $commentProfile->avatar_url : $comment->user->avatar; $commentName = $commentProfile ? $commentProfile->display_name : $comment->user->name; @endphp
{{ $commentName }}
{{ $commentName }} • {{ $comment->formatted_date }} @if($comment->is_edited) (edited) @endif
@if($comment->canEdit(auth()->user())) @endif @if($comment->canBeDeletedBy(auth()->user())) @endif
@if($editingComment === $comment->id)
@error('editContent') {{ $message }} @enderror
@else

{{ $comment->content }}

@endif
@if(auth()->check())
@foreach(['like' => '👍', 'love' => '❤️', 'celebrate' => '🎉', 'fire' => '🔥', 'thinking' => '🤔'] as $type => $emoji) @endforeach
@if($comment->reaction_counts && array_sum($comment->reaction_counts) > 0)
@php $reactionEmojis = ['like' => '👍', 'love' => '❤️', 'celebrate' => '🎉', 'fire' => '🔥', 'thinking' => '🤔']; @endphp @foreach($comment->reaction_counts as $type => $count) @if($count > 0) {{ $reactionEmojis[$type] ?? '👍' }} {{ $count }} @endif @endforeach
@endif
@endif
@if($canComment) @endif
@if($replyingTo === $comment->id)
{{ auth()->user()->name }}
@error('replyContent') {{ $message }} @enderror
@endif @if($comment->replies->count() > 0)
@foreach($comment->replies as $reply) @php $replyProfile = $profiles->get($reply->user_id); $replyAvatar = $replyProfile ? $replyProfile->avatar_url : $reply->user->avatar; $replyName = $replyProfile ? $replyProfile->display_name : $reply->user->name; @endphp
{{ $replyName }}
{{ $replyName }} • {{ $reply->formatted_date }}
@if($reply->canEdit(auth()->user())) @endif @if($reply->canBeDeletedBy(auth()->user())) @endif
@if($editingComment === $reply->id)
@error('editContent') {{ $message }} @enderror
@else

{{ $reply->content }}

@endif
@endforeach
@endif
@empty

No Comments Yet

@if($canComment)

Be the first to leave a comment!

@else

No comments have been posted yet.

@endif
@endforelse