@include('socialbase::components.scrollbar-styles') @if($isOpen)
@if($selectedConversation) @endif

Messages

@if(!$selectedConversation) @endif
@if(!$selectedConversation)
@forelse($recentConversations as $conversation)
@if($conversation['type'] !== 'system') @endif
@if($conversation['type'] === 'direct' && $conversation['other_user']) {{ $conversation['other_user']['name'] }}

{{ $conversation['other_user']['name'] }}

@if($conversation['last_message'])

{{ \Illuminate\Support\Str::limit(strip_tags(preg_replace('/\*\*|\*|__|_|~~|`|```|\|\||\[([^\]]+)\]\([^\)]+\)/', '$1', $conversation['last_message']->content)), 50) }}

@endif @if($conversation['last_message_at'])

{{ $conversation['last_message_at']->diffForHumans() }}

@endif
@if($conversation['unread_count'] > 0) {{ $conversation['unread_count'] }} @endif @elseif($conversation['type'] === 'group') @if(isset($conversation['participants']) && count($conversation['participants']) > 0)
@foreach(array_slice($conversation['participants'], 0, 2) as $participant) @if($participant['avatar']) {{ $participant['name'] }} @else
{{ strtoupper(substr($participant['name'], 0, 1)) }}
@endif @endforeach
@else
@endif

{{ $conversation['subject'] ?? 'Group Chat' }} ({{ $conversation['participants_count'] ?? 0 }})

@if($conversation['last_message'])

{{ \Illuminate\Support\Str::limit(strip_tags(preg_replace('/\*\*|\*|__|_|~~|`|```|\|\||\[([^\]]+)\]\([^\)]+\)/', '$1', $conversation['last_message']->content)), 50) }}

@endif @if($conversation['last_message_at'])

{{ $conversation['last_message_at']->diffForHumans() }}

@endif
@if($conversation['unread_count'] > 0) {{ $conversation['unread_count'] }} @endif @elseif($conversation['type'] === 'system')

System Messages

@if($conversation['last_message'])

{{ \Illuminate\Support\Str::limit(strip_tags(preg_replace('/\*\*|\*|__|_|~~|`|```|\|\||\[([^\]]+)\]\([^\)]+\)/', '$1', $conversation['last_message']->content)), 50) }}

@endif
@if($conversation['unread_count'] > 0) {{ $conversation['unread_count'] }} @endif @endif
@empty

No messages yet

Start a conversation to see it here

@endforelse
View All Messages
@else
@php $currentConv = collect($recentConversations)->firstWhere('id', $selectedConversation); $otherUser = $currentConv['other_user'] ?? null; @endphp @if($otherUser) @elseif($currentConv && $currentConv['type'] === 'group')
@if(count($currentConv['participants']) > 0)
@foreach(array_slice($currentConv['participants'], 0, 2) as $participant) @if($participant['avatar']) {{ $participant['name'] }} @endif @endforeach
@endif

{{ $currentConv['subject'] ?? 'Group Chat' }}

{{ $currentConv['participants_count'] ?? count($currentConv['participants'] ?? []) }} members

@if($currentConv['is_creator'] ?? false) @endif
@endif
@forelse($messages as $message)
@if(!$message['is_system'] && !$message['is_mine']) {{ $message['sender_name'] }} @endif
@if($message['is_system'])

SYSTEM

{!! \Paymenter\Extensions\Others\SocialBase\Helpers\MessageFormatter::format($message['content']) !!}
@else
@if(!empty($message['content']))
{!! \Paymenter\Extensions\Others\SocialBase\Helpers\MessageFormatter::format($message['content']) !!}
@endif @if(!empty($message['attachments']))
@foreach($message['attachments'] as $index => $attachment) @php $isImage = in_array(strtolower($attachment['extension'] ?? ''), ['jpg', 'jpeg', 'png', 'gif', 'webp']); $isVideo = in_array(strtolower($attachment['extension'] ?? ''), ['mp4', 'mov', 'avi']); $secureUrl = route('socialbase.messages.attachment.download', ['messageId' => $message['id'], 'attachmentIndex' => $index]); @endphp @if($isImage) {{ $attachment['name'] ?? 'Image' }} @elseif($isVideo) @else {{ $attachment['name'] ?? 'file' }} @endif @endforeach
@endif
@if(!$message['is_system'])
@if(!$message['is_mine']) @endif
@endif
@endif @if(isset($message['reactions']) && count($message['reactions']) > 0)
@foreach($message['reactions'] as $type => $reaction) @endforeach
@endif

{{ $message['created_at']->format('g:i A') }}

@empty

No messages yet

@endforelse
@php $currentConv = collect($recentConversations)->firstWhere('id', $selectedConversation); $isSystemConversation = $currentConv && $currentConv['type'] === 'system'; @endphp
@if($isSystemConversation)

Read-only conversation

@else @if(!empty($attachments))
@foreach($attachments as $index => $attachment) @php $extension = strtolower($attachment->getClientOriginalExtension()); $isImage = in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'webp']); $isVideo = in_array($extension, ['mp4', 'mov', 'avi']); @endphp
@if($isImage) Preview @elseif($isVideo)
@else
{{ $extension }}
@endif
{{ Str::limit($attachment->getClientOriginalName(), 12) }}
@endforeach
@endif
@error('newMessage')

{{ $message }}

@enderror @error('attachments.*')

{{ $message }}

@enderror @endif
@endif
@endif @if(!$isOpen) @endif @if($selectedConversation && isset($recentConversations)) @php $currentConversation = collect($recentConversations)->firstWhere('id', $selectedConversation); $otherUser = $currentConversation['other_user'] ?? null; @endphp @if($otherUser) @endif @endif @if($showMembersModal)

Group Members

Manage group members

@foreach($groupMembers as $member)
{{ $member['name'] }}

{{ $member['name'] }} @if($member['is_creator']) Creator @endif

{{ $member['email'] }}

@if(!$member['is_creator'] && isset($recentConversations)) @php $conv = collect($recentConversations)->firstWhere('id', $selectedConversation); @endphp @if($conv && Auth::id() == ($conv['created_by'] ?? null)) @endif @endif
@endforeach
@endif @if($showAddMembersModal)

Add Members

Invite people to the group

@foreach($availableUsers as $user)
@if(in_array($user['id'], $selectedUsersToAdd)) @endif
{{ $user['name'] }}

{{ $user['name'] }}

@endforeach
@if(count($selectedUsersToAdd) > 0)

{{ count($selectedUsersToAdd) }} {{ count($selectedUsersToAdd) === 1 ? 'user' : 'users' }} selected

@endif
@endif @if($showRenameModal)

Rename Group

Choose a new name

@error('newGroupName')

{{ $message }}

@enderror
@endif