@extends('layouts.app', ['title' => __('Ticket Details')]) @section('content')
{{-- HEADER --}}

#{{ $ticket->id }} {{ $ticket->subject }} {{ strtoupper($ticket->status) }}

{{-- BODY --}}
@include('partials.flash') {{-- INITIAL MESSAGE --}}
{{ __('Initial Inquiry') }}

{{ $ticket->description }}

{{ $ticket->created_at->format('d M Y, h:i A') }}
{{-- CHAT --}}
{{ __('Conversation') }}
@foreach($ticket->responses as $response) @php $sender = strtolower(trim($response->sender_type ?? '')); @endphp @if(in_array($sender, ['admin', 'staff', 'support'])) {{-- SUPPORT MESSAGE --}}
{{ __('Support Team') }}
{{ $response->response }}
{{ $response->created_at->format('h:i A | d M') }}
@else {{-- USER MESSAGE --}}
{{ __('You') }}
{{ $response->response }}
{{ $response->created_at->format('h:i A | d M') }}
@endif @endforeach

{{-- REPLY FORM --}}
@csrf
@if ($errors->has('response')) {{ $errors->first('response') }} @endif
@if(!$adminReplied)

{{ __('Replying is disabled until an administrator responds.') }}

@endif
@include('layouts.footers.auth')
{{-- STYLES --}} @endsection