@extends('layouts.tenant') @section('title', 'Chat - Conversa') @section('content')

Conversas

@forelse($conversations as $conversation)
{{ strtoupper(substr($conversation->name, 0, 2)) }}

{{ $conversation->name }}

@if($conversation->last_message_at) {{ \Carbon\Carbon::parse($conversation->last_message_at)->diffForHumans() }} @endif

{{ $conversation->email }}

@if($conversation->last_message)

@if($conversation->last_message_direction == 'outbound') Você: @endif {{ Str::limit($conversation->last_message, 30) }}

@if($conversation->unread_count > 0) {{ $conversation->unread_count }} @endif
@endif
@empty

Nenhuma conversa encontrada

@endforelse
@if($client)
{{ strtoupper(substr($client->name, 0, 2)) }}

{{ $client->name }}

{{ $client->email }}

@forelse($messages as $message)
@if($message->direction == 'outbound')

{{ $message->message }}

{{ $message->created_at->format('H:i') }} @if($message->status == 'delivered') @elseif($message->status == 'read') @endif
@else

{{ $message->message }}

{{ $message->created_at->format('H:i') }} @if($message->status != 'read') Não lida @endif
@endif
@empty

Nenhuma mensagem ainda

Envie a primeira mensagem para iniciar a conversa

@endforelse
@csrf
@else

Selecione uma conversa

Escolha uma conversa da lista para começar a conversar

@endif
@endsection @push('scripts') @endpush