{{-- Main content (conversation) --}}
{{-- Ticket header --}}
#{{ $ticket->id }} {{-- Status badge --}} @switch($ticket->status) @case('open') {{ __('Open') }} @break @case('in_progress') {{ __('In Progress') }} @break @case('waiting') {{ __('Waiting') }} @break @case('resolved') {{ __('Resolved') }} @break @case('closed') {{ __('Closed') }} @break @default {{ ucfirst($ticket->status) }} @endswitch {{-- Priority badge --}} @switch($ticket->priority) @case('low') {{ __('Low Priority') }} @break @case('medium') {{ __('Medium Priority') }} @break @case('high') {{ __('High Priority') }} @break @case('urgent') {{ __('Urgent') }} @break @endswitch

{{ $ticket->subject }}

@if($ticket->category) {{ ucfirst($ticket->category) }} @endif {{ __('Created:') }} {{ $ticket->created_at->format('M j, Y \\a\\t g:i A') }} @if($ticket->updated_at->ne($ticket->created_at)) {{ __('Updated:') }} {{ $ticket->updated_at->diffForHumans() }} @endif
{{-- Original ticket body --}}
{{ $ticket->user?->initials ?? '??' }}

{{ $ticket->user?->name ?? __('Unknown User') }}

{{ $ticket->created_at->format('M j, Y \\a\\t g:i A') }}

{{ __('Customer') }}
{!! nl2br(e($ticket->body)) !!}
{{-- Conversation thread (replies) --}} @if($ticket->ticketReplies->count())
@foreach($ticket->ticketReplies as $reply)
@if($reply->is_admin_reply)
{{ $reply->user ? $reply->user->initials : 'AD' }}

{{ $reply->user?->name ?? __('Admin') }}

{{ $reply->created_at->format('M j, Y \\a\\t g:i A') }}

{{ __('Admin') }} @else
{{ $reply->user?->initials ?? '??' }}

{{ $reply->user?->name ?? __('Unknown User') }}

{{ $reply->created_at->format('M j, Y \\a\\t g:i A') }}

{{ __('Customer') }} @endif
{!! nl2br(e($reply->body)) !!}
@endforeach
@endif {{-- Reply form --}} @if($ticket->status !== 'closed')

{{ __('Reply to Ticket') }}

@csrf @error('body')

{{ $message }}

@enderror
@endif
{{-- Sidebar --}}
{{-- Customer Info --}}

{{ __('Customer Info') }}

{{ $ticket->user?->initials ?? '??' }}

{{ $ticket->user?->name ?? __('Unknown User') }}

{{ $ticket->user?->email ?? __('N/A') }}

@if($ticket->workspace)
{{ __('Workspace') }} {{ $ticket->workspace->name }}
@endif @if($ticket->user)
{{ __('Member Since') }} {{ $ticket->user->created_at->format('M j, Y') }}
@endif
@if($ticket->user) {{ __('View Full Profile') }} @endif
{{-- Status Update --}}

{{ __('Update Status') }}

@csrf @method('PATCH')
{{-- Ticket Details --}}

{{ __('Ticket Details') }}

{{ __('Ticket ID') }} #{{ $ticket->id }}
{{ __('Priority') }} {{ ucfirst($ticket->priority) }}
@if($ticket->category)
{{ __('Category') }} {{ ucfirst($ticket->category) }}
@endif @if($ticket->assignedTo)
{{ __('Assigned To') }} {{ $ticket->assignedTo->name }}
@endif
{{ __('Replies') }} {{ $ticket->ticketReplies->count() }}
{{ __('Created') }} {{ $ticket->created_at->format('M j, Y') }}
{{ __('Last Updated') }} {{ $ticket->updated_at->diffForHumans() }}