@props([ 'comment', 'post', 'board', 'depth' => 0, 'authGuard' => 'tenant', 'commentDestroyRoute' => '', 'commentDestroyAction' => '', 'commentReplyEnabled' => true, ]) @php $authorName = $comment->user?->name ?? $comment->guest_name ?? '익명'; $authUser = auth($authGuard)->user(); $canEditComment = auth($authGuard)->check() ? (auth($authGuard)->id() === $comment->user_id || $board->canEditComments($authUser)) : ! $comment->user_id; $canDeleteComment = auth($authGuard)->check() ? (auth($authGuard)->id() === $comment->user_id || $board->canDeleteComments($authUser)) : ! $comment->user_id; @endphp @php $commentDestroyAction = str_contains($commentDestroyAction, '__COMMENT__') ? str_replace('__COMMENT__', (string) $comment->id, $commentDestroyAction) : $commentDestroyAction; $commentDestroyAction = $commentDestroyAction !== '' ? $commentDestroyAction : ($commentDestroyRoute !== '' ? route($commentDestroyRoute, ['board' => $board, 'post' => $post, 'comment' => $comment]) : ''); @endphp