@extends('layouts.app')
@push('styles')
@endpush
@section('content')
@php
$clientId = $contract->user_id;
$supplierId = $contract->suppliers->user_id ?? null;
@endphp
{{-- Info del contrato --}}
Contrato Activo #{{ $contract->id }}
Cliente: {{ $contract->user->name ?? '—' }}
Proveedor: {{ $contract->suppliers->company_name ?? '—' }}
Categoría: {{ $contract->categories->name ?? '—' }}
Monto: ${{ $contract->amount }}
Cita: {{ $contract->appointment }}
Status: {{ $contract->status->name ?? $contract->status_id }}
{{-- Leyenda --}}
Cliente
Proveedor
{{-- Mensajes --}}
@forelse($comments as $comment)
@php
if ($comment->user_id == $clientId) {
$side = 'right';
$label = 'Cliente';
} elseif ($comment->user_id == $supplierId) {
$side = 'left';
$label = 'Proveedor';
} else {
$side = 'center';
$label = 'Moderador';
}
@endphp
{{ $label }} — {{ $comment->user->name ?? '—' }}
{{ $comment->comment }}
{{ $comment->created_at->format('d/m/Y H:i') }}
@empty
Sin mensajes aún.
@endforelse
{{-- Paginación --}}
@if($comments->hasPages())
{{ $comments->links() }}
@endif
{{-- Input del moderador --}}
{{-- Modal fuera del chat-wrapper --}}