@php $color = $order?->status?->color() ?? 'gray'; @endphp

{{ __('dashboard.kitchen_tickets.order_number', ['id' => $order?->id ?? '?']) }}

{{ $order?->branch?->name ?? __('dashboard.kitchen_tickets.no_branch') }} @if ($order?->table?->name) - {{ __('dashboard.kitchen_tickets.table_name', ['name' => $order->table->name]) }} @endif

{{ __('dashboard.kitchen_tickets.added_at', ['time' => $order?->created_at?->diffForHumans()]) }}

@foreach ($items as $item)
{{ $item->qty }}x

{{ $item->name }}

@if (!$currentKitchen) {{ $item->kitchen?->name ?? __('dashboard.kitchen_tickets.global_kitchen') }} @endif
@if ($item->options->count())

{{ $item->options->pluck('name')->implode(', ') }}

@endif

{{ __('dashboard.kitchen_tickets.notes', ['notes' => $item->notes ?: __('dashboard.kitchen_tickets.no_notes')]) }}

@if ($item->status === \App\Models\OrderItem::STATUS_PENDING) @endif @if ($item->status === \App\Models\OrderItem::STATUS_PREPARING) @endif
@endforeach
@php $hasPending = $items->contains(fn($i) => $i->status === \App\Models\OrderItem::STATUS_PENDING); $allReady = $items->every(fn($i) => $i->status === \App\Models\OrderItem::STATUS_READY); @endphp
@if ($hasPending) @endif @if (!$allReady) @endif