Skip to content

Commit 68de41d

Browse files
committed
Added no comments message
1 parent 0437e68 commit 68de41d

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

resources/views/comment-list.blade.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
<div>
2+
@if ($this->comments->isEmpty())
3+
<div class="flex items-center justify-center p-6 text-center rounded-lg border border-dashed border-gray-300 dark:border-gray-700">
4+
<div class="flex flex-col items-center gap-y-2">
5+
<x-filament::icon
6+
icon="heroicon-o-chat-bubble-left-right"
7+
class="w-8 h-8 text-gray-400 dark:text-gray-500"
8+
/>
9+
10+
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">
11+
No comments yet.
12+
</span>
13+
</div>
14+
</div>
15+
@endif
16+
217
@foreach ($this->comments as $comment)
318
<livewire:commentions::comment
419
:key="'comment-' . $comment->id"

src/Livewire/Concerns/HasMentions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public function mentions()
2626
] :
2727
[
2828
'id' => $mentionable->getKey(),
29-
'name' => $mentionable instanceof HasName
30-
? $mentionable->getFilamentName()
29+
'name' => method_exists($mentionable, 'getCommenterName')
30+
? call_user_func_array([$mentionable, 'getCommenterName'], [])
3131
: (
32-
method_exists($mentionable, 'getCommenterName')
33-
? call_user_method('getCommenterName', $mentionable)
32+
$mentionable instanceof HasName
33+
? $mentionable->getFilamentName()
3434
: $mentionable->name
3535
),
3636
];

0 commit comments

Comments
 (0)