@forelse ($messages as $item)
    <li class="chatbox-list-item {{ $item->sender_id == auth()->id() ? 'message' : 'reply' }}">
        <div class="chatbox-list-item__wrapper">
            @if ($item->user_id != auth()->id())
                <img class="chatbox-list-item__thumb"
                    src="{{ getImage(getFilePath('userProfile') . '/' . $item?->user?->image ?? '', getFileSize('userProfile')) }}"
                    alt="">
            @endif
            <div class="chatbox-list-item__content">
                {{ __($item->message) }}
            </div>
        </div>
        <span class="chatbox-list-item__time">{{ diffForHumans($item->created_at) }}</span>
        @if (json_decode($item->attachment) > 0)
            <div class="chatbox-list-item-attach">
                @foreach (json_decode($item->attachment) as $k => $fileName)
                    <a class="chatbox-list-item-attach__link"
                        href="{{ route('user.contact.seller.attachment.download', [$fileName, $item->id]) }}">
                        <i class="fa-regular fa-file"></i>
                        @lang('Attachment') {{ ++$k }}
                    </a>
                @endforeach
            </div>
        @endif
    </li>
@empty
    @include('Template::partials.data_not_found', [
        'data' => 'No message yet to display',
    ])
@endforelse
