@php $pageConfigs = ['navbarType' => 'hidden', 'contentLayout' => 'wide']; $configData = Helper::appClasses(); $statusMap = [ 'pending' => ['Pendiente', 'warning'], 'confirmed' => ['Confirmado', 'info'], 'at_restaurant' => ['En restaurante', 'primary'], 'en_route' => ['En camino', 'primary'], 'delivered' => ['Entregado', 'success'], 'cancelled' => ['Cancelado', 'danger'], ]; [$statusLabel, $statusColor] = $statusMap[$delivery->status] ?? ['Pendiente', 'warning']; $origin = $delivery->restaurant?->address ?? ''; $destination = $delivery->delivery_address ?? ''; $navApp = auth()->user()->nav_app ?? 'maps'; $navUrl = $navApp === 'waze' ? 'https://waze.com/ul?q=' . urlencode($destination) . '&navigate=yes' : 'https://www.google.com/maps/dir/?api=1&origin=' . urlencode($origin) . '&destination=' . urlencode($destination); @endphp @extends('layouts/layoutMaster') @section('title', 'Pedido') @section('content')

Pedido #{{ $delivery->id }}

{{ $statusLabel }} {{ $delivery->created_at->format('d/m/Y H:i') }}
Cliente
{{ $delivery->customer_name }}
{{ $delivery->customer_phone ?? 'Sin teléfono' }}
Recogida
{{ $delivery->restaurant?->address ?? 'Restaurante' }}
Entrega
{{ $delivery->delivery_address }}
@if ($delivery->delivery_address_extra)
{{ $delivery->delivery_address_extra }}
@endif
@if ($delivery->notes)
Notas
{{ $delivery->notes }}
@endif
Abrir navegación @if ($delivery->status === 'pending')
@csrf
@csrf
@elseif ($delivery->status === 'confirmed')
@csrf
@elseif ($delivery->status === 'at_restaurant')
@csrf
@elseif ($delivery->status === 'en_route')
@csrf
@endif
@endsection @section('page-style') @endsection