51 lines
2.2 KiB
PHP
51 lines
2.2 KiB
PHP
<div>
|
|
|
|
<div>
|
|
@foreach ($comments->other as $other_comment)
|
|
<div class="mx-10">
|
|
<div>
|
|
|
|
@if ($other_comment->status == 1)
|
|
<div class="">
|
|
<div>
|
|
<div
|
|
class="p-5 rounded @if ($other_comment->type == 1) bg-gray-400 @else bg-gray-200 @endif flex flex-col gap-3 m-3">
|
|
<div>
|
|
<h4> name : {{ $other_comment->name }}</h4>
|
|
<p> message : {{ $other_comment->message }}</p>
|
|
</div>
|
|
<div x-data="{ reply_id: 0 }">
|
|
<button @click="reply_id='{{ $other_comment->id }}'"
|
|
class="p-2 bg-blue-300 ">reply</button>
|
|
<div @click.outside="reply_id=0" x-show="reply_id=='{{ $other_comment->id }}'"
|
|
class="flex flex-col gap-5">
|
|
<form>
|
|
<div>
|
|
<input wire:model="comment_name_reply" class="border p-1"
|
|
placeholder="name">
|
|
<input wire:model="comment_message_reply" class="border p-1"
|
|
placeholder="message">
|
|
<button @click="reply_id=0" type="button"
|
|
wire:click="reply({{ $other_comment->id }},{{ $comment->id }})"
|
|
class="bg-green-300 p-2 rounded"> reply </button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
</div>
|
|
<div>
|
|
@livewire('tools.home-comments', ['comments' => $other_comment, 'comment' => $comment, 'blog_id' => $blog_id], key($other_comment->id))
|
|
</div>
|
|
|
|
</div>
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
</div> |