@extends('layouts.app') @section('title', $conversation->contact_name ?: $conversation->contact_identifier) @section('page-title')
{{ $conversation->contact_name ?: $conversation->contact_identifier }}
@endsection @section('content')
{{-- Messages --}}

{{ $conversation->subject ?: 'Conversation' }}

{{ $conversation->message_count }} messages · {{ $conversation->source }}

@csrf
@foreach($conversation->messages as $message)
{{ strtoupper(substr($message->from_name ?: $message->from_identifier, 0, 1)) }}

{{ $message->from_name ?: $message->from_identifier }}

{{ $message->sent_at?->format('M d, Y H:i') }}

@if($message->extractedData)
@if($message->extractedData->reply_required) Reply needed @endif @php $sentColors = ['positive'=>'text-emerald-400','neutral'=>'text-slate-400','negative'=>'text-red-400']; @endphp {{ ucfirst($message->extractedData->sentiment) }}
@endif
{{ Str::limit($message->body_plain ?: strip_tags($message->body_raw), 500) }}
{{-- AI Insights --}} @if($message->extractedData && $message->extractedData->summary)

✨ AI Summary

{{ $message->extractedData->summary }}

@if($message->extractedData->suggested_reply)

💬 Suggested Reply

{{ $message->extractedData->suggested_reply }}

@endif
@endif
@endforeach
{{-- Sidebar --}}
{{-- Commitments --}} @if($conversation->commitments->isNotEmpty())

Commitments

@foreach($conversation->commitments as $c)
@csrf

{{ $c->description }}

{{ $c->made_by === 'me' ? 'You promised' : 'They promised' }}

@endforeach
@endif {{-- Tasks --}} @if($conversation->tasks->isNotEmpty())

Tasks

@foreach($conversation->tasks as $task)
@csrf

{{ $task->title }}

@if($task->due_date)

Due {{ $task->due_date->format('M d') }}

@endif
@endforeach
@endif {{-- Contact Info --}}

Contact

{{ strtoupper(substr($conversation->contact_name ?: '?', 0, 1)) }}

{{ $conversation->contact_name ?: 'Unknown' }}

{{ $conversation->contact_identifier }}

@endsection