@extends('layouts.app') @section('content') @php $otherProfile = $other->profile; $showOnline = $otherProfile?->show_online ?? true; $showLastSeen = $otherProfile?->show_last_seen ?? true; $isOnline = $showOnline && $other->last_seen_at && $other->last_seen_at->diffInMinutes(now()) <= 5; $presenceText = $isOnline ? '🟢 Online' : ($showLastSeen && $other->last_seen_at ? 'Active ' . $other->last_seen_at->diffForHumans() : 'Verified connection'); $actionsHtml = '
Profile →
'; @endphp
← Messages
{{-- UNIFIED REUSABLE PAGE HEADER --}} @include('partials.page-header', [ 'title' => $other->name, 'subtitle' => $presenceText . ' • Private end-to-end communication with ' . $other->name, 'actions' => $actionsHtml, ])
@forelse ($messages as $message) @php($isMine = (bool) $message['mine'])
{{ $isMine ? 'You' : $other->name }} @if (!$isMine) @include('partials.verified-badge', ['user' => $other]) @endif

{{ $message['body'] }}

{{ $message['at'] }} @if ($isMine) @if (($message['status'] ?? '') === 'seen') ✓✓ Seen @elseif (($message['status'] ?? '') === 'delivered') ✓✓ Delivered @else ✓ Sent @endif @endif
@empty
@include('partials.empty-state', [ 'iconSvg' => '', 'title' => 'No messages in this conversation yet.', 'description' => 'Send a warm, respectful message to introduce yourself and start connecting.', ])
@endforelse
@csrf @error('body')

{{ $message }}

@enderror @error('user')

{{ $message }}

@enderror
Press Ctrl+Enter to send
@endsection