kusowl b2132f8c02 refactor: chat time, grouping and toast
- show message time
- group messages by date
- show toast when message sent is failed
2026-02-18 11:38:03 +05:30

26 lines
904 B
PHP

@php use App\Services\ProfileInitialsService; @endphp
<x-chat.layout>
<x-slot:sidebarItems>
@forelse($inboxes as $inbox)
<x-chat.sidebar-item
:name="$inbox->recipient->name"
:link="route('chat.show', $inbox->recipient->id)"
:avatar="(new ProfileInitialsService)->create($inbox->recipient->name)"
:message="$inbox->last_message"/>
@empty
No chats found !
@endforelse
</x-slot:sidebarItems>
<div class="overflow-y-hidden">
@if(isset($recipient))
<x-chat.message-box :recipient="$recipient" :messages="$messages"/>
@else
<div class="w-full h-full flex items-center justify-center">
<p class="font-bold text-5xl text-gray-400">Start a chat ! </p>
</div>
@endif
</div>
<x-ui.toast/>
</x-chat.layout>