@props([ 'board', 'post', 'comments' => collect(), 'authGuard' => 'tenant', 'commentStoreAction' => '', 'commentDestroyRoute' => '', 'commentDestroyAction' => '', 'commentReplyEnabled' => true, ]) @php $canUseCommentForm = $board->canWriteComments(auth($authGuard)->user()); $canViewComments = $board->canViewComments(auth($authGuard)->user()); @endphp

댓글 {{ $canViewComments ? $comments->count() : '' }}

@if ($canViewComments)
@forelse ($comments as $comment) @include('components.posts.comment-item', [ 'comment' => $comment, 'post' => $post, 'board' => $board, 'depth' => 0, 'authGuard' => $authGuard, 'commentDestroyRoute' => $commentDestroyRoute, 'commentDestroyAction' => $commentDestroyAction, 'commentReplyEnabled' => $commentReplyEnabled, ]) @empty
아직 댓글이 없습니다.
@endforelse
@endif @if ($canUseCommentForm)
@csrf @guest($authGuard)
@endguest
댓글 등록
@endif
@push('scripts') @endpush