@php $sel = $this->selectedTicket; @endphp
{{-- LEFT: List (50%) --}}
{{-- Filter pill --}} {{-- Current status badge --}} {{ $status==='active' ? __('Open') : ucfirst($status) }} {{-- Search pill --}}
{{-- List (with skeleton while loading) --}}
@forelse($this->tickets as $t) @php $priority = data_get($t,'meta.priority'); $priorityClass = $priority==='high' ? 'text-danger' : ($priority==='medium' ? 'text-warning' : ($priority==='low' ? 'text-info' : 'text-muted')); $deptClass = 'bg-warning-subtle text-warning-emphasis'; // department (type) $statusPill = $t->status==='active' ? 'bg-info text-dark' : ($t->status==='solved' ? 'text-bg-success' : 'text-bg-secondary'); $isSelected = $selectedPublicId===$t->public_id; @endphp @empty
{{ __('No tickets found.') }}
@endforelse
{{-- Skeleton --}}
@if($sel) @php $stBadge = $sel->status==='active' ? 'bg-info text-dark' : ($sel->status==='solved' ? 'text-bg-success' : 'text-bg-secondary'); $deptBadge = 'bg-warning-subtle text-warning-emphasis'; $selPriority = data_get($sel,'meta.priority'); // high|medium|low|null $selPriorityBadge = $selPriority==='high' ? 'bg-danger-subtle text-danger-emphasis' : ($selPriority==='medium' ? 'bg-warning-subtle text-warning-emphasis' : ($selPriority==='low' ? 'bg-info-subtle text-info-emphasis' : 'text-bg-light')); @endphp {{-- Header: subject + chips --}}
{{ $sel->subject }}
{{ $sel->status==='active' ? __('Open') : ucfirst($sel->status) }} {{ ucfirst($sel->type) }} {{ __('Department') }} @if($selPriority) {{ ucfirst($selPriority) }} {{ __('Priority') }} @endif @if($sel->clinic_id) {{ __('Clinic') }} #{{ $sel->clinic_id }} @endif> {{ $sel->public_id }}
{{ __('Last activity:') }} {{ optional($sel->last_activity_at ?? $sel->updated_at)->toDayDateTimeString() }}
{{-- Thread (فقاعات رسائل أنظف) --}}
@foreach($sel->messages as $m)
{{ $m->is_from_support ? __('Support') : __('You') }} · {{ $m->created_at?->toDayDateTimeString() }}
@if($m->url) @endif
{!! nl2br(e($m->body)) !!}
@if(method_exists($m, 'attachments') && $m->attachments()->exists())
@foreach($m->attachments as $a)
{{ $a->filename }}
@endforeach
@endif
@endforeach
{{-- Composer + رفع مرفقات --}} @if($sel->status === 'active') @else @endif @else
{{ __('Select a ticket to view details') }}
{{ __('Your conversation will appear here.') }}
@endif
{{-- Alpine filter modal --}}