@if($show && $ticket)
{{-- Header --}}

{{ $ticket->title }}

@if($ticket->client) Cliente: {{ $ticket->client->name }} @endif @if($ticket->device) • Equipo: {{ $ticket->device->model_and_serial }} @endif @if($ticket->priority) @php $pClass = match($ticket->priority) { 'baja' => 'bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300', 'media' => 'bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300', 'alta' => 'bg-rose-100 text-rose-800 dark:bg-rose-900/40 dark:text-rose-300', default => 'bg-gray-100 text-gray-800 dark:bg-gray-700', }; @endphp {{ ucfirst($ticket->priority) }} @endif @if($ticket->due_at) Vence: {{ $ticket->due_at->format('d/m/Y H:i') }} @endif
{{-- Tabs --}}
{{-- Content (scrollable) --}}
{{-- Tab General --}}
{{-- Columna principal --}}
@if($ticket->description)

Descripción

{{ $ticket->description }}

@endif {{-- Checklist --}}

Checklist

@forelse($ticket->tasks as $task)
completed ? 'checked' : '' }} wire:click="toggleTask({{ $task->id }})" class="w-4 h-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500"> {{ $task->title }}
@empty

Sin tareas

@endforelse
{{-- Sidebar --}}
@if($ticket->labels->isNotEmpty())

Etiquetas

@foreach($ticket->labels as $label) {{ $label->name }} @endforeach
@endif

Asignados

Estado

{{ ucfirst($ticket->status) }}

{{-- Tab Comentarios --}}
Mencionar:
@forelse($ticket->comments as $comment)
{{ Str::limit($comment->user->name ?? '?', 1) }}

{{ $comment->user->name ?? 'Usuario' }}

{{ $comment->created_at->format('d/m/Y H:i') }}

{!! \App\Livewire\TicketDetailModal::formatMentions($comment->body) !!}

@empty

Sin comentarios. Sé el primero en comentar.

@endforelse
{{-- Tab Eventos --}}
@forelse($ticket->events as $event)
{{ Str::limit($event->user->name ?? '?', 1) }}

{{ \App\Models\TicketEvent::getEventTypes()[$event->event_type] ?? $event->event_type }} — {{ $event->user->name ?? 'Usuario' }} · {{ $event->created_at->format('d/m/Y H:i') }}

@if($event->description)

{{ $event->description }}

@endif
@empty

Sin eventos registrados.

@endforelse
{{-- Tab Presupuesto --}}

{{ __('direx.tickets.budget_section_help') }}

@if($this->canEditBudget())
@forelse($ticket->budgetItems as $item) @empty @endforelse
{{ __('direx.tickets.budget_item_type') }} {{ __('direx.tickets.budget_amount') }} {{ __('direx.tickets.budget_item_description') }}
{{ \App\Models\TicketBudgetItem::typeLabel($item->type) }} $ {{ number_format((float)$item->amount, 2, ',', '.') }} {{ $item->description ?? '—' }}
{{ __('direx.tickets.budget_no_items') }}
@php $subtotals = $this->getBudgetSubtotalsByCategory(); @endphp
@foreach($subtotals as $type => $total)

{{ \App\Models\TicketBudgetItem::typeLabel($type) }}: $ {{ number_format($total, 2, ',', '.') }}

@endforeach

{{ __('direx.tickets.budget_total') }}: $ {{ number_format($ticket->budget_total, 2, ',', '.') }}

@else
@forelse($ticket->budgetItems as $item) @empty @endforelse
{{ __('direx.tickets.budget_item_type') }} {{ __('direx.tickets.budget_amount') }} {{ __('direx.tickets.budget_item_description') }}
{{ \App\Models\TicketBudgetItem::typeLabel($item->type) }} $ {{ number_format((float)$item->amount, 2, ',', '.') }} {{ $item->description ?? '—' }}
{{ __('direx.tickets.budget_no_items') }}
@php $subtotals = $this->getBudgetSubtotalsByCategory(); @endphp
@foreach($subtotals as $type => $total)

{{ \App\Models\TicketBudgetItem::typeLabel($type) }}: $ {{ number_format($total, 2, ',', '.') }}

@endforeach

{{ __('direx.tickets.budget_total') }}: $ {{ number_format($ticket->budget_total, 2, ',', '.') }}

@endif
@endif @script @endscript